
bin/kernel_nopage：     文件格式 elf32-i386


Disassembly of section .text:

00100000 <kern_entry>:

.text
.globl kern_entry
kern_entry:
    # load pa of boot pgdir
    movl $REALLOC(__boot_pgdir), %eax
  100000:	b8 00 40 12 40       	mov    $0x40124000,%eax
    movl %eax, %cr3
  100005:	0f 22 d8             	mov    %eax,%cr3

    # enable paging
    movl %cr0, %eax
  100008:	0f 20 c0             	mov    %cr0,%eax
    orl $(CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP), %eax
  10000b:	0d 2f 00 05 80       	or     $0x8005002f,%eax
    andl $~(CR0_TS | CR0_EM), %eax
  100010:	83 e0 f3             	and    $0xfffffff3,%eax
    movl %eax, %cr0
  100013:	0f 22 c0             	mov    %eax,%cr0

    # update eip
    # now, eip = 0x1.....
    leal next, %eax
  100016:	8d 05 1e 00 10 00    	lea    0x10001e,%eax
    # set eip = KERNBASE + 0x1.....
    jmp *%eax
  10001c:	ff e0                	jmp    *%eax

0010001e <next>:
next:

    # unmap va 0 ~ 4M, it's temporary mapping
    xorl %eax, %eax
  10001e:	31 c0                	xor    %eax,%eax
    movl %eax, __boot_pgdir
  100020:	a3 00 40 12 00       	mov    %eax,0x124000

    # set ebp, esp
    movl $0x0, %ebp
  100025:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
  10002a:	bc 00 30 12 00       	mov    $0x123000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
  10002f:	e8 02 00 00 00       	call   100036 <kern_init>

00100034 <spin>:

# should never get here
spin:
    jmp spin
  100034:	eb fe                	jmp    100034 <spin>

00100036 <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);

int
kern_init(void) {
  100036:	f3 0f 1e fb          	endbr32 
  10003a:	55                   	push   %ebp
  10003b:	89 e5                	mov    %esp,%ebp
  10003d:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
  100040:	b8 d0 da 2a 00       	mov    $0x2adad0,%eax
  100045:	2d 48 3a 12 00       	sub    $0x123a48,%eax
  10004a:	89 44 24 08          	mov    %eax,0x8(%esp)
  10004e:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  100055:	00 
  100056:	c7 04 24 48 3a 12 00 	movl   $0x123a48,(%esp)
  10005d:	e8 7c 8c 00 00       	call   108cde <memset>

    cons_init();                // init the console
  100062:	e8 56 16 00 00       	call   1016bd <cons_init>

    const char *message = "(THU.CST) os is loading ...";
  100067:	c7 45 f4 20 95 10 00 	movl   $0x109520,-0xc(%ebp)
    cprintf("%s\n\n", message);
  10006e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100071:	89 44 24 04          	mov    %eax,0x4(%esp)
  100075:	c7 04 24 3c 95 10 00 	movl   $0x10953c,(%esp)
  10007c:	e8 34 02 00 00       	call   1002b5 <cprintf>

    print_kerninfo();
  100081:	e8 f2 08 00 00       	call   100978 <print_kerninfo>

    //grade_backtrace();

    pmm_init();                 // init physical memory management
  100086:	e8 22 43 00 00       	call   1043ad <pmm_init>

    pic_init();                 // init interrupt controller
  10008b:	e8 a8 17 00 00       	call   101838 <pic_init>
    idt_init();                 // init interrupt descriptor table
  100090:	e8 28 19 00 00       	call   1019bd <idt_init>

    clock_init();               // init clock interrupt
  100095:	e8 6a 0d 00 00       	call   100e04 <clock_init>
    intr_enable();              // enable irq interrupt
  10009a:	e8 e5 18 00 00       	call   101984 <intr_enable>
    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    //lab1_switch_test();

    /* do nothing */
    while (1);
  10009f:	eb fe                	jmp    10009f <kern_init+0x69>

001000a1 <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
  1000a1:	f3 0f 1e fb          	endbr32 
  1000a5:	55                   	push   %ebp
  1000a6:	89 e5                	mov    %esp,%ebp
  1000a8:	83 ec 18             	sub    $0x18,%esp
    mon_backtrace(0, NULL, NULL);
  1000ab:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1000b2:	00 
  1000b3:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1000ba:	00 
  1000bb:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  1000c2:	e8 27 0d 00 00       	call   100dee <mon_backtrace>
}
  1000c7:	90                   	nop
  1000c8:	c9                   	leave  
  1000c9:	c3                   	ret    

001000ca <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
  1000ca:	f3 0f 1e fb          	endbr32 
  1000ce:	55                   	push   %ebp
  1000cf:	89 e5                	mov    %esp,%ebp
  1000d1:	53                   	push   %ebx
  1000d2:	83 ec 14             	sub    $0x14,%esp
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
  1000d5:	8d 4d 0c             	lea    0xc(%ebp),%ecx
  1000d8:	8b 55 0c             	mov    0xc(%ebp),%edx
  1000db:	8d 5d 08             	lea    0x8(%ebp),%ebx
  1000de:	8b 45 08             	mov    0x8(%ebp),%eax
  1000e1:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  1000e5:	89 54 24 08          	mov    %edx,0x8(%esp)
  1000e9:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  1000ed:	89 04 24             	mov    %eax,(%esp)
  1000f0:	e8 ac ff ff ff       	call   1000a1 <grade_backtrace2>
}
  1000f5:	90                   	nop
  1000f6:	83 c4 14             	add    $0x14,%esp
  1000f9:	5b                   	pop    %ebx
  1000fa:	5d                   	pop    %ebp
  1000fb:	c3                   	ret    

001000fc <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
  1000fc:	f3 0f 1e fb          	endbr32 
  100100:	55                   	push   %ebp
  100101:	89 e5                	mov    %esp,%ebp
  100103:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace1(arg0, arg2);
  100106:	8b 45 10             	mov    0x10(%ebp),%eax
  100109:	89 44 24 04          	mov    %eax,0x4(%esp)
  10010d:	8b 45 08             	mov    0x8(%ebp),%eax
  100110:	89 04 24             	mov    %eax,(%esp)
  100113:	e8 b2 ff ff ff       	call   1000ca <grade_backtrace1>
}
  100118:	90                   	nop
  100119:	c9                   	leave  
  10011a:	c3                   	ret    

0010011b <grade_backtrace>:

void
grade_backtrace(void) {
  10011b:	f3 0f 1e fb          	endbr32 
  10011f:	55                   	push   %ebp
  100120:	89 e5                	mov    %esp,%ebp
  100122:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
  100125:	b8 36 00 10 00       	mov    $0x100036,%eax
  10012a:	c7 44 24 08 00 00 ff 	movl   $0xffff0000,0x8(%esp)
  100131:	ff 
  100132:	89 44 24 04          	mov    %eax,0x4(%esp)
  100136:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  10013d:	e8 ba ff ff ff       	call   1000fc <grade_backtrace0>
}
  100142:	90                   	nop
  100143:	c9                   	leave  
  100144:	c3                   	ret    

00100145 <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
  100145:	f3 0f 1e fb          	endbr32 
  100149:	55                   	push   %ebp
  10014a:	89 e5                	mov    %esp,%ebp
  10014c:	83 ec 28             	sub    $0x28,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
  10014f:	8c 4d f6             	mov    %cs,-0xa(%ebp)
  100152:	8c 5d f4             	mov    %ds,-0xc(%ebp)
  100155:	8c 45 f2             	mov    %es,-0xe(%ebp)
  100158:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
  10015b:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  10015f:	83 e0 03             	and    $0x3,%eax
  100162:	89 c2                	mov    %eax,%edx
  100164:	a1 00 60 12 00       	mov    0x126000,%eax
  100169:	89 54 24 08          	mov    %edx,0x8(%esp)
  10016d:	89 44 24 04          	mov    %eax,0x4(%esp)
  100171:	c7 04 24 41 95 10 00 	movl   $0x109541,(%esp)
  100178:	e8 38 01 00 00       	call   1002b5 <cprintf>
    cprintf("%d:  cs = %x\n", round, reg1);
  10017d:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100181:	89 c2                	mov    %eax,%edx
  100183:	a1 00 60 12 00       	mov    0x126000,%eax
  100188:	89 54 24 08          	mov    %edx,0x8(%esp)
  10018c:	89 44 24 04          	mov    %eax,0x4(%esp)
  100190:	c7 04 24 4f 95 10 00 	movl   $0x10954f,(%esp)
  100197:	e8 19 01 00 00       	call   1002b5 <cprintf>
    cprintf("%d:  ds = %x\n", round, reg2);
  10019c:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
  1001a0:	89 c2                	mov    %eax,%edx
  1001a2:	a1 00 60 12 00       	mov    0x126000,%eax
  1001a7:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001ab:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001af:	c7 04 24 5d 95 10 00 	movl   $0x10955d,(%esp)
  1001b6:	e8 fa 00 00 00       	call   1002b5 <cprintf>
    cprintf("%d:  es = %x\n", round, reg3);
  1001bb:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  1001bf:	89 c2                	mov    %eax,%edx
  1001c1:	a1 00 60 12 00       	mov    0x126000,%eax
  1001c6:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001ca:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001ce:	c7 04 24 6b 95 10 00 	movl   $0x10956b,(%esp)
  1001d5:	e8 db 00 00 00       	call   1002b5 <cprintf>
    cprintf("%d:  ss = %x\n", round, reg4);
  1001da:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
  1001de:	89 c2                	mov    %eax,%edx
  1001e0:	a1 00 60 12 00       	mov    0x126000,%eax
  1001e5:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001e9:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001ed:	c7 04 24 79 95 10 00 	movl   $0x109579,(%esp)
  1001f4:	e8 bc 00 00 00       	call   1002b5 <cprintf>
    round ++;
  1001f9:	a1 00 60 12 00       	mov    0x126000,%eax
  1001fe:	40                   	inc    %eax
  1001ff:	a3 00 60 12 00       	mov    %eax,0x126000
}
  100204:	90                   	nop
  100205:	c9                   	leave  
  100206:	c3                   	ret    

00100207 <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
  100207:	f3 0f 1e fb          	endbr32 
  10020b:	55                   	push   %ebp
  10020c:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
}
  10020e:	90                   	nop
  10020f:	5d                   	pop    %ebp
  100210:	c3                   	ret    

00100211 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
  100211:	f3 0f 1e fb          	endbr32 
  100215:	55                   	push   %ebp
  100216:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
}
  100218:	90                   	nop
  100219:	5d                   	pop    %ebp
  10021a:	c3                   	ret    

0010021b <lab1_switch_test>:

static void
lab1_switch_test(void) {
  10021b:	f3 0f 1e fb          	endbr32 
  10021f:	55                   	push   %ebp
  100220:	89 e5                	mov    %esp,%ebp
  100222:	83 ec 18             	sub    $0x18,%esp
    lab1_print_cur_status();
  100225:	e8 1b ff ff ff       	call   100145 <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
  10022a:	c7 04 24 88 95 10 00 	movl   $0x109588,(%esp)
  100231:	e8 7f 00 00 00       	call   1002b5 <cprintf>
    lab1_switch_to_user();
  100236:	e8 cc ff ff ff       	call   100207 <lab1_switch_to_user>
    lab1_print_cur_status();
  10023b:	e8 05 ff ff ff       	call   100145 <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
  100240:	c7 04 24 a8 95 10 00 	movl   $0x1095a8,(%esp)
  100247:	e8 69 00 00 00       	call   1002b5 <cprintf>
    lab1_switch_to_kernel();
  10024c:	e8 c0 ff ff ff       	call   100211 <lab1_switch_to_kernel>
    lab1_print_cur_status();
  100251:	e8 ef fe ff ff       	call   100145 <lab1_print_cur_status>
}
  100256:	90                   	nop
  100257:	c9                   	leave  
  100258:	c3                   	ret    

00100259 <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
  100259:	f3 0f 1e fb          	endbr32 
  10025d:	55                   	push   %ebp
  10025e:	89 e5                	mov    %esp,%ebp
  100260:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
  100263:	8b 45 08             	mov    0x8(%ebp),%eax
  100266:	89 04 24             	mov    %eax,(%esp)
  100269:	e8 80 14 00 00       	call   1016ee <cons_putc>
    (*cnt) ++;
  10026e:	8b 45 0c             	mov    0xc(%ebp),%eax
  100271:	8b 00                	mov    (%eax),%eax
  100273:	8d 50 01             	lea    0x1(%eax),%edx
  100276:	8b 45 0c             	mov    0xc(%ebp),%eax
  100279:	89 10                	mov    %edx,(%eax)
}
  10027b:	90                   	nop
  10027c:	c9                   	leave  
  10027d:	c3                   	ret    

0010027e <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
  10027e:	f3 0f 1e fb          	endbr32 
  100282:	55                   	push   %ebp
  100283:	89 e5                	mov    %esp,%ebp
  100285:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  100288:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
  10028f:	8b 45 0c             	mov    0xc(%ebp),%eax
  100292:	89 44 24 0c          	mov    %eax,0xc(%esp)
  100296:	8b 45 08             	mov    0x8(%ebp),%eax
  100299:	89 44 24 08          	mov    %eax,0x8(%esp)
  10029d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  1002a0:	89 44 24 04          	mov    %eax,0x4(%esp)
  1002a4:	c7 04 24 59 02 10 00 	movl   $0x100259,(%esp)
  1002ab:	e8 9a 8d 00 00       	call   10904a <vprintfmt>
    return cnt;
  1002b0:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  1002b3:	c9                   	leave  
  1002b4:	c3                   	ret    

001002b5 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
  1002b5:	f3 0f 1e fb          	endbr32 
  1002b9:	55                   	push   %ebp
  1002ba:	89 e5                	mov    %esp,%ebp
  1002bc:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  1002bf:	8d 45 0c             	lea    0xc(%ebp),%eax
  1002c2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
  1002c5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1002c8:	89 44 24 04          	mov    %eax,0x4(%esp)
  1002cc:	8b 45 08             	mov    0x8(%ebp),%eax
  1002cf:	89 04 24             	mov    %eax,(%esp)
  1002d2:	e8 a7 ff ff ff       	call   10027e <vcprintf>
  1002d7:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  1002da:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  1002dd:	c9                   	leave  
  1002de:	c3                   	ret    

001002df <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
  1002df:	f3 0f 1e fb          	endbr32 
  1002e3:	55                   	push   %ebp
  1002e4:	89 e5                	mov    %esp,%ebp
  1002e6:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
  1002e9:	8b 45 08             	mov    0x8(%ebp),%eax
  1002ec:	89 04 24             	mov    %eax,(%esp)
  1002ef:	e8 fa 13 00 00       	call   1016ee <cons_putc>
}
  1002f4:	90                   	nop
  1002f5:	c9                   	leave  
  1002f6:	c3                   	ret    

001002f7 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
  1002f7:	f3 0f 1e fb          	endbr32 
  1002fb:	55                   	push   %ebp
  1002fc:	89 e5                	mov    %esp,%ebp
  1002fe:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  100301:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
  100308:	eb 13                	jmp    10031d <cputs+0x26>
        cputch(c, &cnt);
  10030a:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  10030e:	8d 55 f0             	lea    -0x10(%ebp),%edx
  100311:	89 54 24 04          	mov    %edx,0x4(%esp)
  100315:	89 04 24             	mov    %eax,(%esp)
  100318:	e8 3c ff ff ff       	call   100259 <cputch>
    while ((c = *str ++) != '\0') {
  10031d:	8b 45 08             	mov    0x8(%ebp),%eax
  100320:	8d 50 01             	lea    0x1(%eax),%edx
  100323:	89 55 08             	mov    %edx,0x8(%ebp)
  100326:	0f b6 00             	movzbl (%eax),%eax
  100329:	88 45 f7             	mov    %al,-0x9(%ebp)
  10032c:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
  100330:	75 d8                	jne    10030a <cputs+0x13>
    }
    cputch('\n', &cnt);
  100332:	8d 45 f0             	lea    -0x10(%ebp),%eax
  100335:	89 44 24 04          	mov    %eax,0x4(%esp)
  100339:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  100340:	e8 14 ff ff ff       	call   100259 <cputch>
    return cnt;
  100345:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  100348:	c9                   	leave  
  100349:	c3                   	ret    

0010034a <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
  10034a:	f3 0f 1e fb          	endbr32 
  10034e:	55                   	push   %ebp
  10034f:	89 e5                	mov    %esp,%ebp
  100351:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
  100354:	90                   	nop
  100355:	e8 d5 13 00 00       	call   10172f <cons_getc>
  10035a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10035d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100361:	74 f2                	je     100355 <getchar+0xb>
        /* do nothing */;
    return c;
  100363:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  100366:	c9                   	leave  
  100367:	c3                   	ret    

00100368 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
  100368:	f3 0f 1e fb          	endbr32 
  10036c:	55                   	push   %ebp
  10036d:	89 e5                	mov    %esp,%ebp
  10036f:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
  100372:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100376:	74 13                	je     10038b <readline+0x23>
        cprintf("%s", prompt);
  100378:	8b 45 08             	mov    0x8(%ebp),%eax
  10037b:	89 44 24 04          	mov    %eax,0x4(%esp)
  10037f:	c7 04 24 c7 95 10 00 	movl   $0x1095c7,(%esp)
  100386:	e8 2a ff ff ff       	call   1002b5 <cprintf>
    }
    int i = 0, c;
  10038b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
  100392:	e8 b3 ff ff ff       	call   10034a <getchar>
  100397:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
  10039a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  10039e:	79 07                	jns    1003a7 <readline+0x3f>
            return NULL;
  1003a0:	b8 00 00 00 00       	mov    $0x0,%eax
  1003a5:	eb 78                	jmp    10041f <readline+0xb7>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
  1003a7:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
  1003ab:	7e 28                	jle    1003d5 <readline+0x6d>
  1003ad:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
  1003b4:	7f 1f                	jg     1003d5 <readline+0x6d>
            cputchar(c);
  1003b6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1003b9:	89 04 24             	mov    %eax,(%esp)
  1003bc:	e8 1e ff ff ff       	call   1002df <cputchar>
            buf[i ++] = c;
  1003c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1003c4:	8d 50 01             	lea    0x1(%eax),%edx
  1003c7:	89 55 f4             	mov    %edx,-0xc(%ebp)
  1003ca:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1003cd:	88 90 20 60 12 00    	mov    %dl,0x126020(%eax)
  1003d3:	eb 45                	jmp    10041a <readline+0xb2>
        }
        else if (c == '\b' && i > 0) {
  1003d5:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
  1003d9:	75 16                	jne    1003f1 <readline+0x89>
  1003db:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1003df:	7e 10                	jle    1003f1 <readline+0x89>
            cputchar(c);
  1003e1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1003e4:	89 04 24             	mov    %eax,(%esp)
  1003e7:	e8 f3 fe ff ff       	call   1002df <cputchar>
            i --;
  1003ec:	ff 4d f4             	decl   -0xc(%ebp)
  1003ef:	eb 29                	jmp    10041a <readline+0xb2>
        }
        else if (c == '\n' || c == '\r') {
  1003f1:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
  1003f5:	74 06                	je     1003fd <readline+0x95>
  1003f7:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
  1003fb:	75 95                	jne    100392 <readline+0x2a>
            cputchar(c);
  1003fd:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100400:	89 04 24             	mov    %eax,(%esp)
  100403:	e8 d7 fe ff ff       	call   1002df <cputchar>
            buf[i] = '\0';
  100408:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10040b:	05 20 60 12 00       	add    $0x126020,%eax
  100410:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
  100413:	b8 20 60 12 00       	mov    $0x126020,%eax
  100418:	eb 05                	jmp    10041f <readline+0xb7>
        c = getchar();
  10041a:	e9 73 ff ff ff       	jmp    100392 <readline+0x2a>
        }
    }
}
  10041f:	c9                   	leave  
  100420:	c3                   	ret    

00100421 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
  100421:	f3 0f 1e fb          	endbr32 
  100425:	55                   	push   %ebp
  100426:	89 e5                	mov    %esp,%ebp
  100428:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
  10042b:	a1 20 64 12 00       	mov    0x126420,%eax
  100430:	85 c0                	test   %eax,%eax
  100432:	75 5b                	jne    10048f <__panic+0x6e>
        goto panic_dead;
    }
    is_panic = 1;
  100434:	c7 05 20 64 12 00 01 	movl   $0x1,0x126420
  10043b:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
  10043e:	8d 45 14             	lea    0x14(%ebp),%eax
  100441:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
  100444:	8b 45 0c             	mov    0xc(%ebp),%eax
  100447:	89 44 24 08          	mov    %eax,0x8(%esp)
  10044b:	8b 45 08             	mov    0x8(%ebp),%eax
  10044e:	89 44 24 04          	mov    %eax,0x4(%esp)
  100452:	c7 04 24 ca 95 10 00 	movl   $0x1095ca,(%esp)
  100459:	e8 57 fe ff ff       	call   1002b5 <cprintf>
    vcprintf(fmt, ap);
  10045e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100461:	89 44 24 04          	mov    %eax,0x4(%esp)
  100465:	8b 45 10             	mov    0x10(%ebp),%eax
  100468:	89 04 24             	mov    %eax,(%esp)
  10046b:	e8 0e fe ff ff       	call   10027e <vcprintf>
    cprintf("\n");
  100470:	c7 04 24 e6 95 10 00 	movl   $0x1095e6,(%esp)
  100477:	e8 39 fe ff ff       	call   1002b5 <cprintf>
    
    cprintf("stack trackback:\n");
  10047c:	c7 04 24 e8 95 10 00 	movl   $0x1095e8,(%esp)
  100483:	e8 2d fe ff ff       	call   1002b5 <cprintf>
    print_stackframe();
  100488:	e8 3d 06 00 00       	call   100aca <print_stackframe>
  10048d:	eb 01                	jmp    100490 <__panic+0x6f>
        goto panic_dead;
  10048f:	90                   	nop
    
    va_end(ap);

panic_dead:
    intr_disable();
  100490:	e8 fb 14 00 00       	call   101990 <intr_disable>
    while (1) {
        kmonitor(NULL);
  100495:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  10049c:	e8 74 08 00 00       	call   100d15 <kmonitor>
  1004a1:	eb f2                	jmp    100495 <__panic+0x74>

001004a3 <__warn>:
    }
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
  1004a3:	f3 0f 1e fb          	endbr32 
  1004a7:	55                   	push   %ebp
  1004a8:	89 e5                	mov    %esp,%ebp
  1004aa:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
  1004ad:	8d 45 14             	lea    0x14(%ebp),%eax
  1004b0:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
  1004b3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1004b6:	89 44 24 08          	mov    %eax,0x8(%esp)
  1004ba:	8b 45 08             	mov    0x8(%ebp),%eax
  1004bd:	89 44 24 04          	mov    %eax,0x4(%esp)
  1004c1:	c7 04 24 fa 95 10 00 	movl   $0x1095fa,(%esp)
  1004c8:	e8 e8 fd ff ff       	call   1002b5 <cprintf>
    vcprintf(fmt, ap);
  1004cd:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1004d0:	89 44 24 04          	mov    %eax,0x4(%esp)
  1004d4:	8b 45 10             	mov    0x10(%ebp),%eax
  1004d7:	89 04 24             	mov    %eax,(%esp)
  1004da:	e8 9f fd ff ff       	call   10027e <vcprintf>
    cprintf("\n");
  1004df:	c7 04 24 e6 95 10 00 	movl   $0x1095e6,(%esp)
  1004e6:	e8 ca fd ff ff       	call   1002b5 <cprintf>
    va_end(ap);
}
  1004eb:	90                   	nop
  1004ec:	c9                   	leave  
  1004ed:	c3                   	ret    

001004ee <is_kernel_panic>:

bool
is_kernel_panic(void) {
  1004ee:	f3 0f 1e fb          	endbr32 
  1004f2:	55                   	push   %ebp
  1004f3:	89 e5                	mov    %esp,%ebp
    return is_panic;
  1004f5:	a1 20 64 12 00       	mov    0x126420,%eax
}
  1004fa:	5d                   	pop    %ebp
  1004fb:	c3                   	ret    

001004fc <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
  1004fc:	f3 0f 1e fb          	endbr32 
  100500:	55                   	push   %ebp
  100501:	89 e5                	mov    %esp,%ebp
  100503:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
  100506:	8b 45 0c             	mov    0xc(%ebp),%eax
  100509:	8b 00                	mov    (%eax),%eax
  10050b:	89 45 fc             	mov    %eax,-0x4(%ebp)
  10050e:	8b 45 10             	mov    0x10(%ebp),%eax
  100511:	8b 00                	mov    (%eax),%eax
  100513:	89 45 f8             	mov    %eax,-0x8(%ebp)
  100516:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
  10051d:	e9 ca 00 00 00       	jmp    1005ec <stab_binsearch+0xf0>
        int true_m = (l + r) / 2, m = true_m;
  100522:	8b 55 fc             	mov    -0x4(%ebp),%edx
  100525:	8b 45 f8             	mov    -0x8(%ebp),%eax
  100528:	01 d0                	add    %edx,%eax
  10052a:	89 c2                	mov    %eax,%edx
  10052c:	c1 ea 1f             	shr    $0x1f,%edx
  10052f:	01 d0                	add    %edx,%eax
  100531:	d1 f8                	sar    %eax
  100533:	89 45 ec             	mov    %eax,-0x14(%ebp)
  100536:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100539:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
  10053c:	eb 03                	jmp    100541 <stab_binsearch+0x45>
            m --;
  10053e:	ff 4d f0             	decl   -0x10(%ebp)
        while (m >= l && stabs[m].n_type != type) {
  100541:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100544:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  100547:	7c 1f                	jl     100568 <stab_binsearch+0x6c>
  100549:	8b 55 f0             	mov    -0x10(%ebp),%edx
  10054c:	89 d0                	mov    %edx,%eax
  10054e:	01 c0                	add    %eax,%eax
  100550:	01 d0                	add    %edx,%eax
  100552:	c1 e0 02             	shl    $0x2,%eax
  100555:	89 c2                	mov    %eax,%edx
  100557:	8b 45 08             	mov    0x8(%ebp),%eax
  10055a:	01 d0                	add    %edx,%eax
  10055c:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  100560:	0f b6 c0             	movzbl %al,%eax
  100563:	39 45 14             	cmp    %eax,0x14(%ebp)
  100566:	75 d6                	jne    10053e <stab_binsearch+0x42>
        }
        if (m < l) {    // no match in [l, m]
  100568:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10056b:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  10056e:	7d 09                	jge    100579 <stab_binsearch+0x7d>
            l = true_m + 1;
  100570:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100573:	40                   	inc    %eax
  100574:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
  100577:	eb 73                	jmp    1005ec <stab_binsearch+0xf0>
        }

        // actual binary search
        any_matches = 1;
  100579:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
  100580:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100583:	89 d0                	mov    %edx,%eax
  100585:	01 c0                	add    %eax,%eax
  100587:	01 d0                	add    %edx,%eax
  100589:	c1 e0 02             	shl    $0x2,%eax
  10058c:	89 c2                	mov    %eax,%edx
  10058e:	8b 45 08             	mov    0x8(%ebp),%eax
  100591:	01 d0                	add    %edx,%eax
  100593:	8b 40 08             	mov    0x8(%eax),%eax
  100596:	39 45 18             	cmp    %eax,0x18(%ebp)
  100599:	76 11                	jbe    1005ac <stab_binsearch+0xb0>
            *region_left = m;
  10059b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10059e:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1005a1:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
  1005a3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1005a6:	40                   	inc    %eax
  1005a7:	89 45 fc             	mov    %eax,-0x4(%ebp)
  1005aa:	eb 40                	jmp    1005ec <stab_binsearch+0xf0>
        } else if (stabs[m].n_value > addr) {
  1005ac:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1005af:	89 d0                	mov    %edx,%eax
  1005b1:	01 c0                	add    %eax,%eax
  1005b3:	01 d0                	add    %edx,%eax
  1005b5:	c1 e0 02             	shl    $0x2,%eax
  1005b8:	89 c2                	mov    %eax,%edx
  1005ba:	8b 45 08             	mov    0x8(%ebp),%eax
  1005bd:	01 d0                	add    %edx,%eax
  1005bf:	8b 40 08             	mov    0x8(%eax),%eax
  1005c2:	39 45 18             	cmp    %eax,0x18(%ebp)
  1005c5:	73 14                	jae    1005db <stab_binsearch+0xdf>
            *region_right = m - 1;
  1005c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1005ca:	8d 50 ff             	lea    -0x1(%eax),%edx
  1005cd:	8b 45 10             	mov    0x10(%ebp),%eax
  1005d0:	89 10                	mov    %edx,(%eax)
            r = m - 1;
  1005d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1005d5:	48                   	dec    %eax
  1005d6:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1005d9:	eb 11                	jmp    1005ec <stab_binsearch+0xf0>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
  1005db:	8b 45 0c             	mov    0xc(%ebp),%eax
  1005de:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1005e1:	89 10                	mov    %edx,(%eax)
            l = m;
  1005e3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1005e6:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
  1005e9:	ff 45 18             	incl   0x18(%ebp)
    while (l <= r) {
  1005ec:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1005ef:	3b 45 f8             	cmp    -0x8(%ebp),%eax
  1005f2:	0f 8e 2a ff ff ff    	jle    100522 <stab_binsearch+0x26>
        }
    }

    if (!any_matches) {
  1005f8:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1005fc:	75 0f                	jne    10060d <stab_binsearch+0x111>
        *region_right = *region_left - 1;
  1005fe:	8b 45 0c             	mov    0xc(%ebp),%eax
  100601:	8b 00                	mov    (%eax),%eax
  100603:	8d 50 ff             	lea    -0x1(%eax),%edx
  100606:	8b 45 10             	mov    0x10(%ebp),%eax
  100609:	89 10                	mov    %edx,(%eax)
        l = *region_right;
        for (; l > *region_left && stabs[l].n_type != type; l --)
            /* do nothing */;
        *region_left = l;
    }
}
  10060b:	eb 3e                	jmp    10064b <stab_binsearch+0x14f>
        l = *region_right;
  10060d:	8b 45 10             	mov    0x10(%ebp),%eax
  100610:	8b 00                	mov    (%eax),%eax
  100612:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
  100615:	eb 03                	jmp    10061a <stab_binsearch+0x11e>
  100617:	ff 4d fc             	decl   -0x4(%ebp)
  10061a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10061d:	8b 00                	mov    (%eax),%eax
  10061f:	39 45 fc             	cmp    %eax,-0x4(%ebp)
  100622:	7e 1f                	jle    100643 <stab_binsearch+0x147>
  100624:	8b 55 fc             	mov    -0x4(%ebp),%edx
  100627:	89 d0                	mov    %edx,%eax
  100629:	01 c0                	add    %eax,%eax
  10062b:	01 d0                	add    %edx,%eax
  10062d:	c1 e0 02             	shl    $0x2,%eax
  100630:	89 c2                	mov    %eax,%edx
  100632:	8b 45 08             	mov    0x8(%ebp),%eax
  100635:	01 d0                	add    %edx,%eax
  100637:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  10063b:	0f b6 c0             	movzbl %al,%eax
  10063e:	39 45 14             	cmp    %eax,0x14(%ebp)
  100641:	75 d4                	jne    100617 <stab_binsearch+0x11b>
        *region_left = l;
  100643:	8b 45 0c             	mov    0xc(%ebp),%eax
  100646:	8b 55 fc             	mov    -0x4(%ebp),%edx
  100649:	89 10                	mov    %edx,(%eax)
}
  10064b:	90                   	nop
  10064c:	c9                   	leave  
  10064d:	c3                   	ret    

0010064e <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
  10064e:	f3 0f 1e fb          	endbr32 
  100652:	55                   	push   %ebp
  100653:	89 e5                	mov    %esp,%ebp
  100655:	83 ec 58             	sub    $0x58,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
  100658:	8b 45 0c             	mov    0xc(%ebp),%eax
  10065b:	c7 00 18 96 10 00    	movl   $0x109618,(%eax)
    info->eip_line = 0;
  100661:	8b 45 0c             	mov    0xc(%ebp),%eax
  100664:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
  10066b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10066e:	c7 40 08 18 96 10 00 	movl   $0x109618,0x8(%eax)
    info->eip_fn_namelen = 9;
  100675:	8b 45 0c             	mov    0xc(%ebp),%eax
  100678:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
  10067f:	8b 45 0c             	mov    0xc(%ebp),%eax
  100682:	8b 55 08             	mov    0x8(%ebp),%edx
  100685:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
  100688:	8b 45 0c             	mov    0xc(%ebp),%eax
  10068b:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
  100692:	c7 45 f4 b8 b1 10 00 	movl   $0x10b1b8,-0xc(%ebp)
    stab_end = __STAB_END__;
  100699:	c7 45 f0 70 d4 11 00 	movl   $0x11d470,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
  1006a0:	c7 45 ec 71 d4 11 00 	movl   $0x11d471,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
  1006a7:	c7 45 e8 3a 0b 12 00 	movl   $0x120b3a,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
  1006ae:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1006b1:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  1006b4:	76 0b                	jbe    1006c1 <debuginfo_eip+0x73>
  1006b6:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1006b9:	48                   	dec    %eax
  1006ba:	0f b6 00             	movzbl (%eax),%eax
  1006bd:	84 c0                	test   %al,%al
  1006bf:	74 0a                	je     1006cb <debuginfo_eip+0x7d>
        return -1;
  1006c1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  1006c6:	e9 ab 02 00 00       	jmp    100976 <debuginfo_eip+0x328>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
  1006cb:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  1006d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1006d5:	2b 45 f4             	sub    -0xc(%ebp),%eax
  1006d8:	c1 f8 02             	sar    $0x2,%eax
  1006db:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
  1006e1:	48                   	dec    %eax
  1006e2:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
  1006e5:	8b 45 08             	mov    0x8(%ebp),%eax
  1006e8:	89 44 24 10          	mov    %eax,0x10(%esp)
  1006ec:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
  1006f3:	00 
  1006f4:	8d 45 e0             	lea    -0x20(%ebp),%eax
  1006f7:	89 44 24 08          	mov    %eax,0x8(%esp)
  1006fb:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  1006fe:	89 44 24 04          	mov    %eax,0x4(%esp)
  100702:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100705:	89 04 24             	mov    %eax,(%esp)
  100708:	e8 ef fd ff ff       	call   1004fc <stab_binsearch>
    if (lfile == 0)
  10070d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  100710:	85 c0                	test   %eax,%eax
  100712:	75 0a                	jne    10071e <debuginfo_eip+0xd0>
        return -1;
  100714:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  100719:	e9 58 02 00 00       	jmp    100976 <debuginfo_eip+0x328>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
  10071e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  100721:	89 45 dc             	mov    %eax,-0x24(%ebp)
  100724:	8b 45 e0             	mov    -0x20(%ebp),%eax
  100727:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
  10072a:	8b 45 08             	mov    0x8(%ebp),%eax
  10072d:	89 44 24 10          	mov    %eax,0x10(%esp)
  100731:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
  100738:	00 
  100739:	8d 45 d8             	lea    -0x28(%ebp),%eax
  10073c:	89 44 24 08          	mov    %eax,0x8(%esp)
  100740:	8d 45 dc             	lea    -0x24(%ebp),%eax
  100743:	89 44 24 04          	mov    %eax,0x4(%esp)
  100747:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10074a:	89 04 24             	mov    %eax,(%esp)
  10074d:	e8 aa fd ff ff       	call   1004fc <stab_binsearch>

    if (lfun <= rfun) {
  100752:	8b 55 dc             	mov    -0x24(%ebp),%edx
  100755:	8b 45 d8             	mov    -0x28(%ebp),%eax
  100758:	39 c2                	cmp    %eax,%edx
  10075a:	7f 78                	jg     1007d4 <debuginfo_eip+0x186>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
  10075c:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10075f:	89 c2                	mov    %eax,%edx
  100761:	89 d0                	mov    %edx,%eax
  100763:	01 c0                	add    %eax,%eax
  100765:	01 d0                	add    %edx,%eax
  100767:	c1 e0 02             	shl    $0x2,%eax
  10076a:	89 c2                	mov    %eax,%edx
  10076c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10076f:	01 d0                	add    %edx,%eax
  100771:	8b 10                	mov    (%eax),%edx
  100773:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100776:	2b 45 ec             	sub    -0x14(%ebp),%eax
  100779:	39 c2                	cmp    %eax,%edx
  10077b:	73 22                	jae    10079f <debuginfo_eip+0x151>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
  10077d:	8b 45 dc             	mov    -0x24(%ebp),%eax
  100780:	89 c2                	mov    %eax,%edx
  100782:	89 d0                	mov    %edx,%eax
  100784:	01 c0                	add    %eax,%eax
  100786:	01 d0                	add    %edx,%eax
  100788:	c1 e0 02             	shl    $0x2,%eax
  10078b:	89 c2                	mov    %eax,%edx
  10078d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100790:	01 d0                	add    %edx,%eax
  100792:	8b 10                	mov    (%eax),%edx
  100794:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100797:	01 c2                	add    %eax,%edx
  100799:	8b 45 0c             	mov    0xc(%ebp),%eax
  10079c:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
  10079f:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1007a2:	89 c2                	mov    %eax,%edx
  1007a4:	89 d0                	mov    %edx,%eax
  1007a6:	01 c0                	add    %eax,%eax
  1007a8:	01 d0                	add    %edx,%eax
  1007aa:	c1 e0 02             	shl    $0x2,%eax
  1007ad:	89 c2                	mov    %eax,%edx
  1007af:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1007b2:	01 d0                	add    %edx,%eax
  1007b4:	8b 50 08             	mov    0x8(%eax),%edx
  1007b7:	8b 45 0c             	mov    0xc(%ebp),%eax
  1007ba:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
  1007bd:	8b 45 0c             	mov    0xc(%ebp),%eax
  1007c0:	8b 40 10             	mov    0x10(%eax),%eax
  1007c3:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
  1007c6:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1007c9:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
  1007cc:	8b 45 d8             	mov    -0x28(%ebp),%eax
  1007cf:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1007d2:	eb 15                	jmp    1007e9 <debuginfo_eip+0x19b>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
  1007d4:	8b 45 0c             	mov    0xc(%ebp),%eax
  1007d7:	8b 55 08             	mov    0x8(%ebp),%edx
  1007da:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
  1007dd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1007e0:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
  1007e3:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1007e6:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
  1007e9:	8b 45 0c             	mov    0xc(%ebp),%eax
  1007ec:	8b 40 08             	mov    0x8(%eax),%eax
  1007ef:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
  1007f6:	00 
  1007f7:	89 04 24             	mov    %eax,(%esp)
  1007fa:	e8 53 83 00 00       	call   108b52 <strfind>
  1007ff:	8b 55 0c             	mov    0xc(%ebp),%edx
  100802:	8b 52 08             	mov    0x8(%edx),%edx
  100805:	29 d0                	sub    %edx,%eax
  100807:	89 c2                	mov    %eax,%edx
  100809:	8b 45 0c             	mov    0xc(%ebp),%eax
  10080c:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
  10080f:	8b 45 08             	mov    0x8(%ebp),%eax
  100812:	89 44 24 10          	mov    %eax,0x10(%esp)
  100816:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
  10081d:	00 
  10081e:	8d 45 d0             	lea    -0x30(%ebp),%eax
  100821:	89 44 24 08          	mov    %eax,0x8(%esp)
  100825:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  100828:	89 44 24 04          	mov    %eax,0x4(%esp)
  10082c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10082f:	89 04 24             	mov    %eax,(%esp)
  100832:	e8 c5 fc ff ff       	call   1004fc <stab_binsearch>
    if (lline <= rline) {
  100837:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  10083a:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10083d:	39 c2                	cmp    %eax,%edx
  10083f:	7f 23                	jg     100864 <debuginfo_eip+0x216>
        info->eip_line = stabs[rline].n_desc;
  100841:	8b 45 d0             	mov    -0x30(%ebp),%eax
  100844:	89 c2                	mov    %eax,%edx
  100846:	89 d0                	mov    %edx,%eax
  100848:	01 c0                	add    %eax,%eax
  10084a:	01 d0                	add    %edx,%eax
  10084c:	c1 e0 02             	shl    $0x2,%eax
  10084f:	89 c2                	mov    %eax,%edx
  100851:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100854:	01 d0                	add    %edx,%eax
  100856:	0f b7 40 06          	movzwl 0x6(%eax),%eax
  10085a:	89 c2                	mov    %eax,%edx
  10085c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10085f:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
  100862:	eb 11                	jmp    100875 <debuginfo_eip+0x227>
        return -1;
  100864:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  100869:	e9 08 01 00 00       	jmp    100976 <debuginfo_eip+0x328>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
  10086e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100871:	48                   	dec    %eax
  100872:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    while (lline >= lfile
  100875:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  100878:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10087b:	39 c2                	cmp    %eax,%edx
  10087d:	7c 56                	jl     1008d5 <debuginfo_eip+0x287>
           && stabs[lline].n_type != N_SOL
  10087f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100882:	89 c2                	mov    %eax,%edx
  100884:	89 d0                	mov    %edx,%eax
  100886:	01 c0                	add    %eax,%eax
  100888:	01 d0                	add    %edx,%eax
  10088a:	c1 e0 02             	shl    $0x2,%eax
  10088d:	89 c2                	mov    %eax,%edx
  10088f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100892:	01 d0                	add    %edx,%eax
  100894:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  100898:	3c 84                	cmp    $0x84,%al
  10089a:	74 39                	je     1008d5 <debuginfo_eip+0x287>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
  10089c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10089f:	89 c2                	mov    %eax,%edx
  1008a1:	89 d0                	mov    %edx,%eax
  1008a3:	01 c0                	add    %eax,%eax
  1008a5:	01 d0                	add    %edx,%eax
  1008a7:	c1 e0 02             	shl    $0x2,%eax
  1008aa:	89 c2                	mov    %eax,%edx
  1008ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1008af:	01 d0                	add    %edx,%eax
  1008b1:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  1008b5:	3c 64                	cmp    $0x64,%al
  1008b7:	75 b5                	jne    10086e <debuginfo_eip+0x220>
  1008b9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1008bc:	89 c2                	mov    %eax,%edx
  1008be:	89 d0                	mov    %edx,%eax
  1008c0:	01 c0                	add    %eax,%eax
  1008c2:	01 d0                	add    %edx,%eax
  1008c4:	c1 e0 02             	shl    $0x2,%eax
  1008c7:	89 c2                	mov    %eax,%edx
  1008c9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1008cc:	01 d0                	add    %edx,%eax
  1008ce:	8b 40 08             	mov    0x8(%eax),%eax
  1008d1:	85 c0                	test   %eax,%eax
  1008d3:	74 99                	je     10086e <debuginfo_eip+0x220>
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
  1008d5:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1008d8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1008db:	39 c2                	cmp    %eax,%edx
  1008dd:	7c 42                	jl     100921 <debuginfo_eip+0x2d3>
  1008df:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1008e2:	89 c2                	mov    %eax,%edx
  1008e4:	89 d0                	mov    %edx,%eax
  1008e6:	01 c0                	add    %eax,%eax
  1008e8:	01 d0                	add    %edx,%eax
  1008ea:	c1 e0 02             	shl    $0x2,%eax
  1008ed:	89 c2                	mov    %eax,%edx
  1008ef:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1008f2:	01 d0                	add    %edx,%eax
  1008f4:	8b 10                	mov    (%eax),%edx
  1008f6:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1008f9:	2b 45 ec             	sub    -0x14(%ebp),%eax
  1008fc:	39 c2                	cmp    %eax,%edx
  1008fe:	73 21                	jae    100921 <debuginfo_eip+0x2d3>
        info->eip_file = stabstr + stabs[lline].n_strx;
  100900:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100903:	89 c2                	mov    %eax,%edx
  100905:	89 d0                	mov    %edx,%eax
  100907:	01 c0                	add    %eax,%eax
  100909:	01 d0                	add    %edx,%eax
  10090b:	c1 e0 02             	shl    $0x2,%eax
  10090e:	89 c2                	mov    %eax,%edx
  100910:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100913:	01 d0                	add    %edx,%eax
  100915:	8b 10                	mov    (%eax),%edx
  100917:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10091a:	01 c2                	add    %eax,%edx
  10091c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10091f:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
  100921:	8b 55 dc             	mov    -0x24(%ebp),%edx
  100924:	8b 45 d8             	mov    -0x28(%ebp),%eax
  100927:	39 c2                	cmp    %eax,%edx
  100929:	7d 46                	jge    100971 <debuginfo_eip+0x323>
        for (lline = lfun + 1;
  10092b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10092e:	40                   	inc    %eax
  10092f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  100932:	eb 16                	jmp    10094a <debuginfo_eip+0x2fc>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
  100934:	8b 45 0c             	mov    0xc(%ebp),%eax
  100937:	8b 40 14             	mov    0x14(%eax),%eax
  10093a:	8d 50 01             	lea    0x1(%eax),%edx
  10093d:	8b 45 0c             	mov    0xc(%ebp),%eax
  100940:	89 50 14             	mov    %edx,0x14(%eax)
             lline ++) {
  100943:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100946:	40                   	inc    %eax
  100947:	89 45 d4             	mov    %eax,-0x2c(%ebp)
             lline < rfun && stabs[lline].n_type == N_PSYM;
  10094a:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  10094d:	8b 45 d8             	mov    -0x28(%ebp),%eax
        for (lline = lfun + 1;
  100950:	39 c2                	cmp    %eax,%edx
  100952:	7d 1d                	jge    100971 <debuginfo_eip+0x323>
             lline < rfun && stabs[lline].n_type == N_PSYM;
  100954:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100957:	89 c2                	mov    %eax,%edx
  100959:	89 d0                	mov    %edx,%eax
  10095b:	01 c0                	add    %eax,%eax
  10095d:	01 d0                	add    %edx,%eax
  10095f:	c1 e0 02             	shl    $0x2,%eax
  100962:	89 c2                	mov    %eax,%edx
  100964:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100967:	01 d0                	add    %edx,%eax
  100969:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  10096d:	3c a0                	cmp    $0xa0,%al
  10096f:	74 c3                	je     100934 <debuginfo_eip+0x2e6>
        }
    }
    return 0;
  100971:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100976:	c9                   	leave  
  100977:	c3                   	ret    

00100978 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
  100978:	f3 0f 1e fb          	endbr32 
  10097c:	55                   	push   %ebp
  10097d:	89 e5                	mov    %esp,%ebp
  10097f:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
  100982:	c7 04 24 22 96 10 00 	movl   $0x109622,(%esp)
  100989:	e8 27 f9 ff ff       	call   1002b5 <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
  10098e:	c7 44 24 04 36 00 10 	movl   $0x100036,0x4(%esp)
  100995:	00 
  100996:	c7 04 24 3b 96 10 00 	movl   $0x10963b,(%esp)
  10099d:	e8 13 f9 ff ff       	call   1002b5 <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
  1009a2:	c7 44 24 04 02 95 10 	movl   $0x109502,0x4(%esp)
  1009a9:	00 
  1009aa:	c7 04 24 53 96 10 00 	movl   $0x109653,(%esp)
  1009b1:	e8 ff f8 ff ff       	call   1002b5 <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
  1009b6:	c7 44 24 04 48 3a 12 	movl   $0x123a48,0x4(%esp)
  1009bd:	00 
  1009be:	c7 04 24 6b 96 10 00 	movl   $0x10966b,(%esp)
  1009c5:	e8 eb f8 ff ff       	call   1002b5 <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
  1009ca:	c7 44 24 04 d0 da 2a 	movl   $0x2adad0,0x4(%esp)
  1009d1:	00 
  1009d2:	c7 04 24 83 96 10 00 	movl   $0x109683,(%esp)
  1009d9:	e8 d7 f8 ff ff       	call   1002b5 <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
  1009de:	b8 d0 da 2a 00       	mov    $0x2adad0,%eax
  1009e3:	2d 36 00 10 00       	sub    $0x100036,%eax
  1009e8:	05 ff 03 00 00       	add    $0x3ff,%eax
  1009ed:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
  1009f3:	85 c0                	test   %eax,%eax
  1009f5:	0f 48 c2             	cmovs  %edx,%eax
  1009f8:	c1 f8 0a             	sar    $0xa,%eax
  1009fb:	89 44 24 04          	mov    %eax,0x4(%esp)
  1009ff:	c7 04 24 9c 96 10 00 	movl   $0x10969c,(%esp)
  100a06:	e8 aa f8 ff ff       	call   1002b5 <cprintf>
}
  100a0b:	90                   	nop
  100a0c:	c9                   	leave  
  100a0d:	c3                   	ret    

00100a0e <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
  100a0e:	f3 0f 1e fb          	endbr32 
  100a12:	55                   	push   %ebp
  100a13:	89 e5                	mov    %esp,%ebp
  100a15:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
  100a1b:	8d 45 dc             	lea    -0x24(%ebp),%eax
  100a1e:	89 44 24 04          	mov    %eax,0x4(%esp)
  100a22:	8b 45 08             	mov    0x8(%ebp),%eax
  100a25:	89 04 24             	mov    %eax,(%esp)
  100a28:	e8 21 fc ff ff       	call   10064e <debuginfo_eip>
  100a2d:	85 c0                	test   %eax,%eax
  100a2f:	74 15                	je     100a46 <print_debuginfo+0x38>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
  100a31:	8b 45 08             	mov    0x8(%ebp),%eax
  100a34:	89 44 24 04          	mov    %eax,0x4(%esp)
  100a38:	c7 04 24 c6 96 10 00 	movl   $0x1096c6,(%esp)
  100a3f:	e8 71 f8 ff ff       	call   1002b5 <cprintf>
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
    }
}
  100a44:	eb 6c                	jmp    100ab2 <print_debuginfo+0xa4>
        for (j = 0; j < info.eip_fn_namelen; j ++) {
  100a46:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100a4d:	eb 1b                	jmp    100a6a <print_debuginfo+0x5c>
            fnname[j] = info.eip_fn_name[j];
  100a4f:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  100a52:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100a55:	01 d0                	add    %edx,%eax
  100a57:	0f b6 10             	movzbl (%eax),%edx
  100a5a:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
  100a60:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100a63:	01 c8                	add    %ecx,%eax
  100a65:	88 10                	mov    %dl,(%eax)
        for (j = 0; j < info.eip_fn_namelen; j ++) {
  100a67:	ff 45 f4             	incl   -0xc(%ebp)
  100a6a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100a6d:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  100a70:	7c dd                	jl     100a4f <print_debuginfo+0x41>
        fnname[j] = '\0';
  100a72:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
  100a78:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100a7b:	01 d0                	add    %edx,%eax
  100a7d:	c6 00 00             	movb   $0x0,(%eax)
                fnname, eip - info.eip_fn_addr);
  100a80:	8b 45 ec             	mov    -0x14(%ebp),%eax
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
  100a83:	8b 55 08             	mov    0x8(%ebp),%edx
  100a86:	89 d1                	mov    %edx,%ecx
  100a88:	29 c1                	sub    %eax,%ecx
  100a8a:	8b 55 e0             	mov    -0x20(%ebp),%edx
  100a8d:	8b 45 dc             	mov    -0x24(%ebp),%eax
  100a90:	89 4c 24 10          	mov    %ecx,0x10(%esp)
  100a94:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
  100a9a:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  100a9e:	89 54 24 08          	mov    %edx,0x8(%esp)
  100aa2:	89 44 24 04          	mov    %eax,0x4(%esp)
  100aa6:	c7 04 24 e2 96 10 00 	movl   $0x1096e2,(%esp)
  100aad:	e8 03 f8 ff ff       	call   1002b5 <cprintf>
}
  100ab2:	90                   	nop
  100ab3:	c9                   	leave  
  100ab4:	c3                   	ret    

00100ab5 <read_eip>:

static __noinline uint32_t
read_eip(void) {
  100ab5:	f3 0f 1e fb          	endbr32 
  100ab9:	55                   	push   %ebp
  100aba:	89 e5                	mov    %esp,%ebp
  100abc:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
  100abf:	8b 45 04             	mov    0x4(%ebp),%eax
  100ac2:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
  100ac5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  100ac8:	c9                   	leave  
  100ac9:	c3                   	ret    

00100aca <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
  100aca:	f3 0f 1e fb          	endbr32 
  100ace:	55                   	push   %ebp
  100acf:	89 e5                	mov    %esp,%ebp
  100ad1:	53                   	push   %ebx
  100ad2:	83 ec 34             	sub    $0x34,%esp
}

static inline uint32_t
read_ebp(void) {
    uint32_t ebp;
    asm volatile ("movl %%ebp, %0" : "=r" (ebp));
  100ad5:	89 e8                	mov    %ebp,%eax
  100ad7:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return ebp;
  100ada:	8b 45 e8             	mov    -0x18(%ebp),%eax
      *    (3.4) call print_debuginfo(eip-1) to print the C calling function name and line number, etc.
      *    (3.5) popup a calling stackframe
      *           NOTICE: the calling funciton's return addr eip  = ss:[ebp+4]
      *                   the calling funciton's ebp = ss:[ebp]
      */
      uint32_t ebp=read_ebp();
  100add:	89 45 f4             	mov    %eax,-0xc(%ebp)
      uint32_t eip=read_eip();
  100ae0:	e8 d0 ff ff ff       	call   100ab5 <read_eip>
  100ae5:	89 45 f0             	mov    %eax,-0x10(%ebp)
      int dpt=0;
  100ae8:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
      while(eip&&ebp&&dpt<STACKFRAME_DEPTH)
  100aef:	e9 90 00 00 00       	jmp    100b84 <print_stackframe+0xba>
      {
	cprintf("the value of ebp ==> 0x%08x\n",ebp);
  100af4:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100af7:	89 44 24 04          	mov    %eax,0x4(%esp)
  100afb:	c7 04 24 f4 96 10 00 	movl   $0x1096f4,(%esp)
  100b02:	e8 ae f7 ff ff       	call   1002b5 <cprintf>
	cprintf("the value of eip ==> 0x%08x\n",eip);
  100b07:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100b0a:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b0e:	c7 04 24 11 97 10 00 	movl   $0x109711,(%esp)
  100b15:	e8 9b f7 ff ff       	call   1002b5 <cprintf>
	cprintf("args:0x%08x 0x%08x 0x%08x 0x%08x\n",*(unsigned int*)(ebp+8),*(unsigned int*)(ebp+12),*(unsigned int*)(ebp+16),*(unsigned int*)(ebp+20) );
  100b1a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b1d:	83 c0 14             	add    $0x14,%eax
  100b20:	8b 18                	mov    (%eax),%ebx
  100b22:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b25:	83 c0 10             	add    $0x10,%eax
  100b28:	8b 08                	mov    (%eax),%ecx
  100b2a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b2d:	83 c0 0c             	add    $0xc,%eax
  100b30:	8b 10                	mov    (%eax),%edx
  100b32:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b35:	83 c0 08             	add    $0x8,%eax
  100b38:	8b 00                	mov    (%eax),%eax
  100b3a:	89 5c 24 10          	mov    %ebx,0x10(%esp)
  100b3e:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  100b42:	89 54 24 08          	mov    %edx,0x8(%esp)
  100b46:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b4a:	c7 04 24 30 97 10 00 	movl   $0x109730,(%esp)
  100b51:	e8 5f f7 ff ff       	call   1002b5 <cprintf>
	print_debuginfo(eip-1);
  100b56:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100b59:	48                   	dec    %eax
  100b5a:	89 04 24             	mov    %eax,(%esp)
  100b5d:	e8 ac fe ff ff       	call   100a0e <print_debuginfo>
	cprintf("\n");
  100b62:	c7 04 24 52 97 10 00 	movl   $0x109752,(%esp)
  100b69:	e8 47 f7 ff ff       	call   1002b5 <cprintf>
	eip=*(uint32_t*)(ebp+4);
  100b6e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b71:	83 c0 04             	add    $0x4,%eax
  100b74:	8b 00                	mov    (%eax),%eax
  100b76:	89 45 f0             	mov    %eax,-0x10(%ebp)
	ebp=*(uint32_t*)ebp;
  100b79:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b7c:	8b 00                	mov    (%eax),%eax
  100b7e:	89 45 f4             	mov    %eax,-0xc(%ebp)
	dpt++;
  100b81:	ff 45 ec             	incl   -0x14(%ebp)
      while(eip&&ebp&&dpt<STACKFRAME_DEPTH)
  100b84:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  100b88:	74 10                	je     100b9a <print_stackframe+0xd0>
  100b8a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100b8e:	74 0a                	je     100b9a <print_stackframe+0xd0>
  100b90:	83 7d ec 13          	cmpl   $0x13,-0x14(%ebp)
  100b94:	0f 8e 5a ff ff ff    	jle    100af4 <print_stackframe+0x2a>
      }
}
  100b9a:	90                   	nop
  100b9b:	83 c4 34             	add    $0x34,%esp
  100b9e:	5b                   	pop    %ebx
  100b9f:	5d                   	pop    %ebp
  100ba0:	c3                   	ret    

00100ba1 <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
  100ba1:	f3 0f 1e fb          	endbr32 
  100ba5:	55                   	push   %ebp
  100ba6:	89 e5                	mov    %esp,%ebp
  100ba8:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
  100bab:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100bb2:	eb 0c                	jmp    100bc0 <parse+0x1f>
            *buf ++ = '\0';
  100bb4:	8b 45 08             	mov    0x8(%ebp),%eax
  100bb7:	8d 50 01             	lea    0x1(%eax),%edx
  100bba:	89 55 08             	mov    %edx,0x8(%ebp)
  100bbd:	c6 00 00             	movb   $0x0,(%eax)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100bc0:	8b 45 08             	mov    0x8(%ebp),%eax
  100bc3:	0f b6 00             	movzbl (%eax),%eax
  100bc6:	84 c0                	test   %al,%al
  100bc8:	74 1d                	je     100be7 <parse+0x46>
  100bca:	8b 45 08             	mov    0x8(%ebp),%eax
  100bcd:	0f b6 00             	movzbl (%eax),%eax
  100bd0:	0f be c0             	movsbl %al,%eax
  100bd3:	89 44 24 04          	mov    %eax,0x4(%esp)
  100bd7:	c7 04 24 d4 97 10 00 	movl   $0x1097d4,(%esp)
  100bde:	e8 39 7f 00 00       	call   108b1c <strchr>
  100be3:	85 c0                	test   %eax,%eax
  100be5:	75 cd                	jne    100bb4 <parse+0x13>
        }
        if (*buf == '\0') {
  100be7:	8b 45 08             	mov    0x8(%ebp),%eax
  100bea:	0f b6 00             	movzbl (%eax),%eax
  100bed:	84 c0                	test   %al,%al
  100bef:	74 65                	je     100c56 <parse+0xb5>
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
  100bf1:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
  100bf5:	75 14                	jne    100c0b <parse+0x6a>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
  100bf7:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
  100bfe:	00 
  100bff:	c7 04 24 d9 97 10 00 	movl   $0x1097d9,(%esp)
  100c06:	e8 aa f6 ff ff       	call   1002b5 <cprintf>
        }
        argv[argc ++] = buf;
  100c0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100c0e:	8d 50 01             	lea    0x1(%eax),%edx
  100c11:	89 55 f4             	mov    %edx,-0xc(%ebp)
  100c14:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  100c1b:	8b 45 0c             	mov    0xc(%ebp),%eax
  100c1e:	01 c2                	add    %eax,%edx
  100c20:	8b 45 08             	mov    0x8(%ebp),%eax
  100c23:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
  100c25:	eb 03                	jmp    100c2a <parse+0x89>
            buf ++;
  100c27:	ff 45 08             	incl   0x8(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
  100c2a:	8b 45 08             	mov    0x8(%ebp),%eax
  100c2d:	0f b6 00             	movzbl (%eax),%eax
  100c30:	84 c0                	test   %al,%al
  100c32:	74 8c                	je     100bc0 <parse+0x1f>
  100c34:	8b 45 08             	mov    0x8(%ebp),%eax
  100c37:	0f b6 00             	movzbl (%eax),%eax
  100c3a:	0f be c0             	movsbl %al,%eax
  100c3d:	89 44 24 04          	mov    %eax,0x4(%esp)
  100c41:	c7 04 24 d4 97 10 00 	movl   $0x1097d4,(%esp)
  100c48:	e8 cf 7e 00 00       	call   108b1c <strchr>
  100c4d:	85 c0                	test   %eax,%eax
  100c4f:	74 d6                	je     100c27 <parse+0x86>
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100c51:	e9 6a ff ff ff       	jmp    100bc0 <parse+0x1f>
            break;
  100c56:	90                   	nop
        }
    }
    return argc;
  100c57:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  100c5a:	c9                   	leave  
  100c5b:	c3                   	ret    

00100c5c <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
  100c5c:	f3 0f 1e fb          	endbr32 
  100c60:	55                   	push   %ebp
  100c61:	89 e5                	mov    %esp,%ebp
  100c63:	53                   	push   %ebx
  100c64:	83 ec 64             	sub    $0x64,%esp
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
  100c67:	8d 45 b0             	lea    -0x50(%ebp),%eax
  100c6a:	89 44 24 04          	mov    %eax,0x4(%esp)
  100c6e:	8b 45 08             	mov    0x8(%ebp),%eax
  100c71:	89 04 24             	mov    %eax,(%esp)
  100c74:	e8 28 ff ff ff       	call   100ba1 <parse>
  100c79:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
  100c7c:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  100c80:	75 0a                	jne    100c8c <runcmd+0x30>
        return 0;
  100c82:	b8 00 00 00 00       	mov    $0x0,%eax
  100c87:	e9 83 00 00 00       	jmp    100d0f <runcmd+0xb3>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100c8c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100c93:	eb 5a                	jmp    100cef <runcmd+0x93>
        if (strcmp(commands[i].name, argv[0]) == 0) {
  100c95:	8b 4d b0             	mov    -0x50(%ebp),%ecx
  100c98:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100c9b:	89 d0                	mov    %edx,%eax
  100c9d:	01 c0                	add    %eax,%eax
  100c9f:	01 d0                	add    %edx,%eax
  100ca1:	c1 e0 02             	shl    $0x2,%eax
  100ca4:	05 00 30 12 00       	add    $0x123000,%eax
  100ca9:	8b 00                	mov    (%eax),%eax
  100cab:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  100caf:	89 04 24             	mov    %eax,(%esp)
  100cb2:	e8 c1 7d 00 00       	call   108a78 <strcmp>
  100cb7:	85 c0                	test   %eax,%eax
  100cb9:	75 31                	jne    100cec <runcmd+0x90>
            return commands[i].func(argc - 1, argv + 1, tf);
  100cbb:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100cbe:	89 d0                	mov    %edx,%eax
  100cc0:	01 c0                	add    %eax,%eax
  100cc2:	01 d0                	add    %edx,%eax
  100cc4:	c1 e0 02             	shl    $0x2,%eax
  100cc7:	05 08 30 12 00       	add    $0x123008,%eax
  100ccc:	8b 10                	mov    (%eax),%edx
  100cce:	8d 45 b0             	lea    -0x50(%ebp),%eax
  100cd1:	83 c0 04             	add    $0x4,%eax
  100cd4:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  100cd7:	8d 59 ff             	lea    -0x1(%ecx),%ebx
  100cda:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  100cdd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  100ce1:	89 44 24 04          	mov    %eax,0x4(%esp)
  100ce5:	89 1c 24             	mov    %ebx,(%esp)
  100ce8:	ff d2                	call   *%edx
  100cea:	eb 23                	jmp    100d0f <runcmd+0xb3>
    for (i = 0; i < NCOMMANDS; i ++) {
  100cec:	ff 45 f4             	incl   -0xc(%ebp)
  100cef:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100cf2:	83 f8 02             	cmp    $0x2,%eax
  100cf5:	76 9e                	jbe    100c95 <runcmd+0x39>
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
  100cf7:	8b 45 b0             	mov    -0x50(%ebp),%eax
  100cfa:	89 44 24 04          	mov    %eax,0x4(%esp)
  100cfe:	c7 04 24 f7 97 10 00 	movl   $0x1097f7,(%esp)
  100d05:	e8 ab f5 ff ff       	call   1002b5 <cprintf>
    return 0;
  100d0a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100d0f:	83 c4 64             	add    $0x64,%esp
  100d12:	5b                   	pop    %ebx
  100d13:	5d                   	pop    %ebp
  100d14:	c3                   	ret    

00100d15 <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
  100d15:	f3 0f 1e fb          	endbr32 
  100d19:	55                   	push   %ebp
  100d1a:	89 e5                	mov    %esp,%ebp
  100d1c:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
  100d1f:	c7 04 24 10 98 10 00 	movl   $0x109810,(%esp)
  100d26:	e8 8a f5 ff ff       	call   1002b5 <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
  100d2b:	c7 04 24 38 98 10 00 	movl   $0x109838,(%esp)
  100d32:	e8 7e f5 ff ff       	call   1002b5 <cprintf>

    if (tf != NULL) {
  100d37:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100d3b:	74 0b                	je     100d48 <kmonitor+0x33>
        print_trapframe(tf);
  100d3d:	8b 45 08             	mov    0x8(%ebp),%eax
  100d40:	89 04 24             	mov    %eax,(%esp)
  100d43:	e8 b5 0e 00 00       	call   101bfd <print_trapframe>
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
  100d48:	c7 04 24 5d 98 10 00 	movl   $0x10985d,(%esp)
  100d4f:	e8 14 f6 ff ff       	call   100368 <readline>
  100d54:	89 45 f4             	mov    %eax,-0xc(%ebp)
  100d57:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100d5b:	74 eb                	je     100d48 <kmonitor+0x33>
            if (runcmd(buf, tf) < 0) {
  100d5d:	8b 45 08             	mov    0x8(%ebp),%eax
  100d60:	89 44 24 04          	mov    %eax,0x4(%esp)
  100d64:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100d67:	89 04 24             	mov    %eax,(%esp)
  100d6a:	e8 ed fe ff ff       	call   100c5c <runcmd>
  100d6f:	85 c0                	test   %eax,%eax
  100d71:	78 02                	js     100d75 <kmonitor+0x60>
        if ((buf = readline("K> ")) != NULL) {
  100d73:	eb d3                	jmp    100d48 <kmonitor+0x33>
                break;
  100d75:	90                   	nop
            }
        }
    }
}
  100d76:	90                   	nop
  100d77:	c9                   	leave  
  100d78:	c3                   	ret    

00100d79 <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
  100d79:	f3 0f 1e fb          	endbr32 
  100d7d:	55                   	push   %ebp
  100d7e:	89 e5                	mov    %esp,%ebp
  100d80:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100d83:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100d8a:	eb 3d                	jmp    100dc9 <mon_help+0x50>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
  100d8c:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100d8f:	89 d0                	mov    %edx,%eax
  100d91:	01 c0                	add    %eax,%eax
  100d93:	01 d0                	add    %edx,%eax
  100d95:	c1 e0 02             	shl    $0x2,%eax
  100d98:	05 04 30 12 00       	add    $0x123004,%eax
  100d9d:	8b 08                	mov    (%eax),%ecx
  100d9f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100da2:	89 d0                	mov    %edx,%eax
  100da4:	01 c0                	add    %eax,%eax
  100da6:	01 d0                	add    %edx,%eax
  100da8:	c1 e0 02             	shl    $0x2,%eax
  100dab:	05 00 30 12 00       	add    $0x123000,%eax
  100db0:	8b 00                	mov    (%eax),%eax
  100db2:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  100db6:	89 44 24 04          	mov    %eax,0x4(%esp)
  100dba:	c7 04 24 61 98 10 00 	movl   $0x109861,(%esp)
  100dc1:	e8 ef f4 ff ff       	call   1002b5 <cprintf>
    for (i = 0; i < NCOMMANDS; i ++) {
  100dc6:	ff 45 f4             	incl   -0xc(%ebp)
  100dc9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100dcc:	83 f8 02             	cmp    $0x2,%eax
  100dcf:	76 bb                	jbe    100d8c <mon_help+0x13>
    }
    return 0;
  100dd1:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100dd6:	c9                   	leave  
  100dd7:	c3                   	ret    

00100dd8 <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
  100dd8:	f3 0f 1e fb          	endbr32 
  100ddc:	55                   	push   %ebp
  100ddd:	89 e5                	mov    %esp,%ebp
  100ddf:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
  100de2:	e8 91 fb ff ff       	call   100978 <print_kerninfo>
    return 0;
  100de7:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100dec:	c9                   	leave  
  100ded:	c3                   	ret    

00100dee <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
  100dee:	f3 0f 1e fb          	endbr32 
  100df2:	55                   	push   %ebp
  100df3:	89 e5                	mov    %esp,%ebp
  100df5:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
  100df8:	e8 cd fc ff ff       	call   100aca <print_stackframe>
    return 0;
  100dfd:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100e02:	c9                   	leave  
  100e03:	c3                   	ret    

00100e04 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
  100e04:	f3 0f 1e fb          	endbr32 
  100e08:	55                   	push   %ebp
  100e09:	89 e5                	mov    %esp,%ebp
  100e0b:	83 ec 28             	sub    $0x28,%esp
  100e0e:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
  100e14:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100e18:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100e1c:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  100e20:	ee                   	out    %al,(%dx)
}
  100e21:	90                   	nop
  100e22:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
  100e28:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100e2c:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100e30:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  100e34:	ee                   	out    %al,(%dx)
}
  100e35:	90                   	nop
  100e36:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
  100e3c:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100e40:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  100e44:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  100e48:	ee                   	out    %al,(%dx)
}
  100e49:	90                   	nop
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
  100e4a:	c7 05 a0 6f 12 00 00 	movl   $0x0,0x126fa0
  100e51:	00 00 00 

    cprintf("++ setup timer interrupts\n");
  100e54:	c7 04 24 6a 98 10 00 	movl   $0x10986a,(%esp)
  100e5b:	e8 55 f4 ff ff       	call   1002b5 <cprintf>
    pic_enable(IRQ_TIMER);
  100e60:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  100e67:	e8 95 09 00 00       	call   101801 <pic_enable>
}
  100e6c:	90                   	nop
  100e6d:	c9                   	leave  
  100e6e:	c3                   	ret    

00100e6f <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
  100e6f:	55                   	push   %ebp
  100e70:	89 e5                	mov    %esp,%ebp
  100e72:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
  100e75:	9c                   	pushf  
  100e76:	58                   	pop    %eax
  100e77:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
  100e7a:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
  100e7d:	25 00 02 00 00       	and    $0x200,%eax
  100e82:	85 c0                	test   %eax,%eax
  100e84:	74 0c                	je     100e92 <__intr_save+0x23>
        intr_disable();
  100e86:	e8 05 0b 00 00       	call   101990 <intr_disable>
        return 1;
  100e8b:	b8 01 00 00 00       	mov    $0x1,%eax
  100e90:	eb 05                	jmp    100e97 <__intr_save+0x28>
    }
    return 0;
  100e92:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100e97:	c9                   	leave  
  100e98:	c3                   	ret    

00100e99 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
  100e99:	55                   	push   %ebp
  100e9a:	89 e5                	mov    %esp,%ebp
  100e9c:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
  100e9f:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100ea3:	74 05                	je     100eaa <__intr_restore+0x11>
        intr_enable();
  100ea5:	e8 da 0a 00 00       	call   101984 <intr_enable>
    }
}
  100eaa:	90                   	nop
  100eab:	c9                   	leave  
  100eac:	c3                   	ret    

00100ead <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
  100ead:	f3 0f 1e fb          	endbr32 
  100eb1:	55                   	push   %ebp
  100eb2:	89 e5                	mov    %esp,%ebp
  100eb4:	83 ec 10             	sub    $0x10,%esp
  100eb7:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100ebd:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  100ec1:	89 c2                	mov    %eax,%edx
  100ec3:	ec                   	in     (%dx),%al
  100ec4:	88 45 f1             	mov    %al,-0xf(%ebp)
  100ec7:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
  100ecd:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100ed1:	89 c2                	mov    %eax,%edx
  100ed3:	ec                   	in     (%dx),%al
  100ed4:	88 45 f5             	mov    %al,-0xb(%ebp)
  100ed7:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
  100edd:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  100ee1:	89 c2                	mov    %eax,%edx
  100ee3:	ec                   	in     (%dx),%al
  100ee4:	88 45 f9             	mov    %al,-0x7(%ebp)
  100ee7:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
  100eed:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
  100ef1:	89 c2                	mov    %eax,%edx
  100ef3:	ec                   	in     (%dx),%al
  100ef4:	88 45 fd             	mov    %al,-0x3(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
  100ef7:	90                   	nop
  100ef8:	c9                   	leave  
  100ef9:	c3                   	ret    

00100efa <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
  100efa:	f3 0f 1e fb          	endbr32 
  100efe:	55                   	push   %ebp
  100eff:	89 e5                	mov    %esp,%ebp
  100f01:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
  100f04:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
  100f0b:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100f0e:	0f b7 00             	movzwl (%eax),%eax
  100f11:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
  100f15:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100f18:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
  100f1d:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100f20:	0f b7 00             	movzwl (%eax),%eax
  100f23:	0f b7 c0             	movzwl %ax,%eax
  100f26:	3d 5a a5 00 00       	cmp    $0xa55a,%eax
  100f2b:	74 12                	je     100f3f <cga_init+0x45>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
  100f2d:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
  100f34:	66 c7 05 46 64 12 00 	movw   $0x3b4,0x126446
  100f3b:	b4 03 
  100f3d:	eb 13                	jmp    100f52 <cga_init+0x58>
    } else {
        *cp = was;
  100f3f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100f42:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  100f46:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
  100f49:	66 c7 05 46 64 12 00 	movw   $0x3d4,0x126446
  100f50:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
  100f52:	0f b7 05 46 64 12 00 	movzwl 0x126446,%eax
  100f59:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
  100f5d:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f61:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  100f65:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  100f69:	ee                   	out    %al,(%dx)
}
  100f6a:	90                   	nop
    pos = inb(addr_6845 + 1) << 8;
  100f6b:	0f b7 05 46 64 12 00 	movzwl 0x126446,%eax
  100f72:	40                   	inc    %eax
  100f73:	0f b7 c0             	movzwl %ax,%eax
  100f76:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100f7a:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
  100f7e:	89 c2                	mov    %eax,%edx
  100f80:	ec                   	in     (%dx),%al
  100f81:	88 45 e9             	mov    %al,-0x17(%ebp)
    return data;
  100f84:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  100f88:	0f b6 c0             	movzbl %al,%eax
  100f8b:	c1 e0 08             	shl    $0x8,%eax
  100f8e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
  100f91:	0f b7 05 46 64 12 00 	movzwl 0x126446,%eax
  100f98:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
  100f9c:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100fa0:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100fa4:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  100fa8:	ee                   	out    %al,(%dx)
}
  100fa9:	90                   	nop
    pos |= inb(addr_6845 + 1);
  100faa:	0f b7 05 46 64 12 00 	movzwl 0x126446,%eax
  100fb1:	40                   	inc    %eax
  100fb2:	0f b7 c0             	movzwl %ax,%eax
  100fb5:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100fb9:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  100fbd:	89 c2                	mov    %eax,%edx
  100fbf:	ec                   	in     (%dx),%al
  100fc0:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
  100fc3:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100fc7:	0f b6 c0             	movzbl %al,%eax
  100fca:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
  100fcd:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100fd0:	a3 40 64 12 00       	mov    %eax,0x126440
    crt_pos = pos;
  100fd5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100fd8:	0f b7 c0             	movzwl %ax,%eax
  100fdb:	66 a3 44 64 12 00    	mov    %ax,0x126444
}
  100fe1:	90                   	nop
  100fe2:	c9                   	leave  
  100fe3:	c3                   	ret    

00100fe4 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
  100fe4:	f3 0f 1e fb          	endbr32 
  100fe8:	55                   	push   %ebp
  100fe9:	89 e5                	mov    %esp,%ebp
  100feb:	83 ec 48             	sub    $0x48,%esp
  100fee:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
  100ff4:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100ff8:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
  100ffc:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
  101000:	ee                   	out    %al,(%dx)
}
  101001:	90                   	nop
  101002:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
  101008:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10100c:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
  101010:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  101014:	ee                   	out    %al,(%dx)
}
  101015:	90                   	nop
  101016:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
  10101c:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101020:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
  101024:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
  101028:	ee                   	out    %al,(%dx)
}
  101029:	90                   	nop
  10102a:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
  101030:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101034:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
  101038:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  10103c:	ee                   	out    %al,(%dx)
}
  10103d:	90                   	nop
  10103e:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
  101044:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101048:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
  10104c:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
  101050:	ee                   	out    %al,(%dx)
}
  101051:	90                   	nop
  101052:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
  101058:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10105c:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  101060:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  101064:	ee                   	out    %al,(%dx)
}
  101065:	90                   	nop
  101066:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
  10106c:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101070:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  101074:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  101078:	ee                   	out    %al,(%dx)
}
  101079:	90                   	nop
  10107a:	66 c7 45 ee fd 03    	movw   $0x3fd,-0x12(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  101080:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
  101084:	89 c2                	mov    %eax,%edx
  101086:	ec                   	in     (%dx),%al
  101087:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
  10108a:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
  10108e:	3c ff                	cmp    $0xff,%al
  101090:	0f 95 c0             	setne  %al
  101093:	0f b6 c0             	movzbl %al,%eax
  101096:	a3 48 64 12 00       	mov    %eax,0x126448
  10109b:	66 c7 45 f2 fa 03    	movw   $0x3fa,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1010a1:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  1010a5:	89 c2                	mov    %eax,%edx
  1010a7:	ec                   	in     (%dx),%al
  1010a8:	88 45 f1             	mov    %al,-0xf(%ebp)
  1010ab:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
  1010b1:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  1010b5:	89 c2                	mov    %eax,%edx
  1010b7:	ec                   	in     (%dx),%al
  1010b8:	88 45 f5             	mov    %al,-0xb(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
  1010bb:	a1 48 64 12 00       	mov    0x126448,%eax
  1010c0:	85 c0                	test   %eax,%eax
  1010c2:	74 0c                	je     1010d0 <serial_init+0xec>
        pic_enable(IRQ_COM1);
  1010c4:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  1010cb:	e8 31 07 00 00       	call   101801 <pic_enable>
    }
}
  1010d0:	90                   	nop
  1010d1:	c9                   	leave  
  1010d2:	c3                   	ret    

001010d3 <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
  1010d3:	f3 0f 1e fb          	endbr32 
  1010d7:	55                   	push   %ebp
  1010d8:	89 e5                	mov    %esp,%ebp
  1010da:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
  1010dd:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  1010e4:	eb 08                	jmp    1010ee <lpt_putc_sub+0x1b>
        delay();
  1010e6:	e8 c2 fd ff ff       	call   100ead <delay>
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
  1010eb:	ff 45 fc             	incl   -0x4(%ebp)
  1010ee:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
  1010f4:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  1010f8:	89 c2                	mov    %eax,%edx
  1010fa:	ec                   	in     (%dx),%al
  1010fb:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  1010fe:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  101102:	84 c0                	test   %al,%al
  101104:	78 09                	js     10110f <lpt_putc_sub+0x3c>
  101106:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
  10110d:	7e d7                	jle    1010e6 <lpt_putc_sub+0x13>
    }
    outb(LPTPORT + 0, c);
  10110f:	8b 45 08             	mov    0x8(%ebp),%eax
  101112:	0f b6 c0             	movzbl %al,%eax
  101115:	66 c7 45 ee 78 03    	movw   $0x378,-0x12(%ebp)
  10111b:	88 45 ed             	mov    %al,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10111e:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  101122:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  101126:	ee                   	out    %al,(%dx)
}
  101127:	90                   	nop
  101128:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
  10112e:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101132:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  101136:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  10113a:	ee                   	out    %al,(%dx)
}
  10113b:	90                   	nop
  10113c:	66 c7 45 f6 7a 03    	movw   $0x37a,-0xa(%ebp)
  101142:	c6 45 f5 08          	movb   $0x8,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101146:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  10114a:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  10114e:	ee                   	out    %al,(%dx)
}
  10114f:	90                   	nop
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
  101150:	90                   	nop
  101151:	c9                   	leave  
  101152:	c3                   	ret    

00101153 <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
  101153:	f3 0f 1e fb          	endbr32 
  101157:	55                   	push   %ebp
  101158:	89 e5                	mov    %esp,%ebp
  10115a:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
  10115d:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
  101161:	74 0d                	je     101170 <lpt_putc+0x1d>
        lpt_putc_sub(c);
  101163:	8b 45 08             	mov    0x8(%ebp),%eax
  101166:	89 04 24             	mov    %eax,(%esp)
  101169:	e8 65 ff ff ff       	call   1010d3 <lpt_putc_sub>
    else {
        lpt_putc_sub('\b');
        lpt_putc_sub(' ');
        lpt_putc_sub('\b');
    }
}
  10116e:	eb 24                	jmp    101194 <lpt_putc+0x41>
        lpt_putc_sub('\b');
  101170:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101177:	e8 57 ff ff ff       	call   1010d3 <lpt_putc_sub>
        lpt_putc_sub(' ');
  10117c:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  101183:	e8 4b ff ff ff       	call   1010d3 <lpt_putc_sub>
        lpt_putc_sub('\b');
  101188:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  10118f:	e8 3f ff ff ff       	call   1010d3 <lpt_putc_sub>
}
  101194:	90                   	nop
  101195:	c9                   	leave  
  101196:	c3                   	ret    

00101197 <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
  101197:	f3 0f 1e fb          	endbr32 
  10119b:	55                   	push   %ebp
  10119c:	89 e5                	mov    %esp,%ebp
  10119e:	53                   	push   %ebx
  10119f:	83 ec 34             	sub    $0x34,%esp
    // set black on white
    if (!(c & ~0xFF)) {
  1011a2:	8b 45 08             	mov    0x8(%ebp),%eax
  1011a5:	25 00 ff ff ff       	and    $0xffffff00,%eax
  1011aa:	85 c0                	test   %eax,%eax
  1011ac:	75 07                	jne    1011b5 <cga_putc+0x1e>
        c |= 0x0700;
  1011ae:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
  1011b5:	8b 45 08             	mov    0x8(%ebp),%eax
  1011b8:	0f b6 c0             	movzbl %al,%eax
  1011bb:	83 f8 0d             	cmp    $0xd,%eax
  1011be:	74 72                	je     101232 <cga_putc+0x9b>
  1011c0:	83 f8 0d             	cmp    $0xd,%eax
  1011c3:	0f 8f a3 00 00 00    	jg     10126c <cga_putc+0xd5>
  1011c9:	83 f8 08             	cmp    $0x8,%eax
  1011cc:	74 0a                	je     1011d8 <cga_putc+0x41>
  1011ce:	83 f8 0a             	cmp    $0xa,%eax
  1011d1:	74 4c                	je     10121f <cga_putc+0x88>
  1011d3:	e9 94 00 00 00       	jmp    10126c <cga_putc+0xd5>
    case '\b':
        if (crt_pos > 0) {
  1011d8:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  1011df:	85 c0                	test   %eax,%eax
  1011e1:	0f 84 af 00 00 00    	je     101296 <cga_putc+0xff>
            crt_pos --;
  1011e7:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  1011ee:	48                   	dec    %eax
  1011ef:	0f b7 c0             	movzwl %ax,%eax
  1011f2:	66 a3 44 64 12 00    	mov    %ax,0x126444
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
  1011f8:	8b 45 08             	mov    0x8(%ebp),%eax
  1011fb:	98                   	cwtl   
  1011fc:	25 00 ff ff ff       	and    $0xffffff00,%eax
  101201:	98                   	cwtl   
  101202:	83 c8 20             	or     $0x20,%eax
  101205:	98                   	cwtl   
  101206:	8b 15 40 64 12 00    	mov    0x126440,%edx
  10120c:	0f b7 0d 44 64 12 00 	movzwl 0x126444,%ecx
  101213:	01 c9                	add    %ecx,%ecx
  101215:	01 ca                	add    %ecx,%edx
  101217:	0f b7 c0             	movzwl %ax,%eax
  10121a:	66 89 02             	mov    %ax,(%edx)
        }
        break;
  10121d:	eb 77                	jmp    101296 <cga_putc+0xff>
    case '\n':
        crt_pos += CRT_COLS;
  10121f:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  101226:	83 c0 50             	add    $0x50,%eax
  101229:	0f b7 c0             	movzwl %ax,%eax
  10122c:	66 a3 44 64 12 00    	mov    %ax,0x126444
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
  101232:	0f b7 1d 44 64 12 00 	movzwl 0x126444,%ebx
  101239:	0f b7 0d 44 64 12 00 	movzwl 0x126444,%ecx
  101240:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
  101245:	89 c8                	mov    %ecx,%eax
  101247:	f7 e2                	mul    %edx
  101249:	c1 ea 06             	shr    $0x6,%edx
  10124c:	89 d0                	mov    %edx,%eax
  10124e:	c1 e0 02             	shl    $0x2,%eax
  101251:	01 d0                	add    %edx,%eax
  101253:	c1 e0 04             	shl    $0x4,%eax
  101256:	29 c1                	sub    %eax,%ecx
  101258:	89 c8                	mov    %ecx,%eax
  10125a:	0f b7 c0             	movzwl %ax,%eax
  10125d:	29 c3                	sub    %eax,%ebx
  10125f:	89 d8                	mov    %ebx,%eax
  101261:	0f b7 c0             	movzwl %ax,%eax
  101264:	66 a3 44 64 12 00    	mov    %ax,0x126444
        break;
  10126a:	eb 2b                	jmp    101297 <cga_putc+0x100>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
  10126c:	8b 0d 40 64 12 00    	mov    0x126440,%ecx
  101272:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  101279:	8d 50 01             	lea    0x1(%eax),%edx
  10127c:	0f b7 d2             	movzwl %dx,%edx
  10127f:	66 89 15 44 64 12 00 	mov    %dx,0x126444
  101286:	01 c0                	add    %eax,%eax
  101288:	8d 14 01             	lea    (%ecx,%eax,1),%edx
  10128b:	8b 45 08             	mov    0x8(%ebp),%eax
  10128e:	0f b7 c0             	movzwl %ax,%eax
  101291:	66 89 02             	mov    %ax,(%edx)
        break;
  101294:	eb 01                	jmp    101297 <cga_putc+0x100>
        break;
  101296:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
  101297:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  10129e:	3d cf 07 00 00       	cmp    $0x7cf,%eax
  1012a3:	76 5d                	jbe    101302 <cga_putc+0x16b>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
  1012a5:	a1 40 64 12 00       	mov    0x126440,%eax
  1012aa:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
  1012b0:	a1 40 64 12 00       	mov    0x126440,%eax
  1012b5:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
  1012bc:	00 
  1012bd:	89 54 24 04          	mov    %edx,0x4(%esp)
  1012c1:	89 04 24             	mov    %eax,(%esp)
  1012c4:	e8 58 7a 00 00       	call   108d21 <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
  1012c9:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
  1012d0:	eb 14                	jmp    1012e6 <cga_putc+0x14f>
            crt_buf[i] = 0x0700 | ' ';
  1012d2:	a1 40 64 12 00       	mov    0x126440,%eax
  1012d7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1012da:	01 d2                	add    %edx,%edx
  1012dc:	01 d0                	add    %edx,%eax
  1012de:	66 c7 00 20 07       	movw   $0x720,(%eax)
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
  1012e3:	ff 45 f4             	incl   -0xc(%ebp)
  1012e6:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
  1012ed:	7e e3                	jle    1012d2 <cga_putc+0x13b>
        }
        crt_pos -= CRT_COLS;
  1012ef:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  1012f6:	83 e8 50             	sub    $0x50,%eax
  1012f9:	0f b7 c0             	movzwl %ax,%eax
  1012fc:	66 a3 44 64 12 00    	mov    %ax,0x126444
    }

    // move that little blinky thing
    outb(addr_6845, 14);
  101302:	0f b7 05 46 64 12 00 	movzwl 0x126446,%eax
  101309:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
  10130d:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101311:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  101315:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  101319:	ee                   	out    %al,(%dx)
}
  10131a:	90                   	nop
    outb(addr_6845 + 1, crt_pos >> 8);
  10131b:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  101322:	c1 e8 08             	shr    $0x8,%eax
  101325:	0f b7 c0             	movzwl %ax,%eax
  101328:	0f b6 c0             	movzbl %al,%eax
  10132b:	0f b7 15 46 64 12 00 	movzwl 0x126446,%edx
  101332:	42                   	inc    %edx
  101333:	0f b7 d2             	movzwl %dx,%edx
  101336:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
  10133a:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10133d:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  101341:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  101345:	ee                   	out    %al,(%dx)
}
  101346:	90                   	nop
    outb(addr_6845, 15);
  101347:	0f b7 05 46 64 12 00 	movzwl 0x126446,%eax
  10134e:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
  101352:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101356:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  10135a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  10135e:	ee                   	out    %al,(%dx)
}
  10135f:	90                   	nop
    outb(addr_6845 + 1, crt_pos);
  101360:	0f b7 05 44 64 12 00 	movzwl 0x126444,%eax
  101367:	0f b6 c0             	movzbl %al,%eax
  10136a:	0f b7 15 46 64 12 00 	movzwl 0x126446,%edx
  101371:	42                   	inc    %edx
  101372:	0f b7 d2             	movzwl %dx,%edx
  101375:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
  101379:	88 45 f1             	mov    %al,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10137c:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  101380:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  101384:	ee                   	out    %al,(%dx)
}
  101385:	90                   	nop
}
  101386:	90                   	nop
  101387:	83 c4 34             	add    $0x34,%esp
  10138a:	5b                   	pop    %ebx
  10138b:	5d                   	pop    %ebp
  10138c:	c3                   	ret    

0010138d <serial_putc_sub>:

static void
serial_putc_sub(int c) {
  10138d:	f3 0f 1e fb          	endbr32 
  101391:	55                   	push   %ebp
  101392:	89 e5                	mov    %esp,%ebp
  101394:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
  101397:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  10139e:	eb 08                	jmp    1013a8 <serial_putc_sub+0x1b>
        delay();
  1013a0:	e8 08 fb ff ff       	call   100ead <delay>
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
  1013a5:	ff 45 fc             	incl   -0x4(%ebp)
  1013a8:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1013ae:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  1013b2:	89 c2                	mov    %eax,%edx
  1013b4:	ec                   	in     (%dx),%al
  1013b5:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  1013b8:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  1013bc:	0f b6 c0             	movzbl %al,%eax
  1013bf:	83 e0 20             	and    $0x20,%eax
  1013c2:	85 c0                	test   %eax,%eax
  1013c4:	75 09                	jne    1013cf <serial_putc_sub+0x42>
  1013c6:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
  1013cd:	7e d1                	jle    1013a0 <serial_putc_sub+0x13>
    }
    outb(COM1 + COM_TX, c);
  1013cf:	8b 45 08             	mov    0x8(%ebp),%eax
  1013d2:	0f b6 c0             	movzbl %al,%eax
  1013d5:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
  1013db:	88 45 f5             	mov    %al,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1013de:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  1013e2:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  1013e6:	ee                   	out    %al,(%dx)
}
  1013e7:	90                   	nop
}
  1013e8:	90                   	nop
  1013e9:	c9                   	leave  
  1013ea:	c3                   	ret    

001013eb <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
  1013eb:	f3 0f 1e fb          	endbr32 
  1013ef:	55                   	push   %ebp
  1013f0:	89 e5                	mov    %esp,%ebp
  1013f2:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
  1013f5:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
  1013f9:	74 0d                	je     101408 <serial_putc+0x1d>
        serial_putc_sub(c);
  1013fb:	8b 45 08             	mov    0x8(%ebp),%eax
  1013fe:	89 04 24             	mov    %eax,(%esp)
  101401:	e8 87 ff ff ff       	call   10138d <serial_putc_sub>
    else {
        serial_putc_sub('\b');
        serial_putc_sub(' ');
        serial_putc_sub('\b');
    }
}
  101406:	eb 24                	jmp    10142c <serial_putc+0x41>
        serial_putc_sub('\b');
  101408:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  10140f:	e8 79 ff ff ff       	call   10138d <serial_putc_sub>
        serial_putc_sub(' ');
  101414:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  10141b:	e8 6d ff ff ff       	call   10138d <serial_putc_sub>
        serial_putc_sub('\b');
  101420:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101427:	e8 61 ff ff ff       	call   10138d <serial_putc_sub>
}
  10142c:	90                   	nop
  10142d:	c9                   	leave  
  10142e:	c3                   	ret    

0010142f <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
  10142f:	f3 0f 1e fb          	endbr32 
  101433:	55                   	push   %ebp
  101434:	89 e5                	mov    %esp,%ebp
  101436:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
  101439:	eb 33                	jmp    10146e <cons_intr+0x3f>
        if (c != 0) {
  10143b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10143f:	74 2d                	je     10146e <cons_intr+0x3f>
            cons.buf[cons.wpos ++] = c;
  101441:	a1 64 66 12 00       	mov    0x126664,%eax
  101446:	8d 50 01             	lea    0x1(%eax),%edx
  101449:	89 15 64 66 12 00    	mov    %edx,0x126664
  10144f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  101452:	88 90 60 64 12 00    	mov    %dl,0x126460(%eax)
            if (cons.wpos == CONSBUFSIZE) {
  101458:	a1 64 66 12 00       	mov    0x126664,%eax
  10145d:	3d 00 02 00 00       	cmp    $0x200,%eax
  101462:	75 0a                	jne    10146e <cons_intr+0x3f>
                cons.wpos = 0;
  101464:	c7 05 64 66 12 00 00 	movl   $0x0,0x126664
  10146b:	00 00 00 
    while ((c = (*proc)()) != -1) {
  10146e:	8b 45 08             	mov    0x8(%ebp),%eax
  101471:	ff d0                	call   *%eax
  101473:	89 45 f4             	mov    %eax,-0xc(%ebp)
  101476:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
  10147a:	75 bf                	jne    10143b <cons_intr+0xc>
            }
        }
    }
}
  10147c:	90                   	nop
  10147d:	90                   	nop
  10147e:	c9                   	leave  
  10147f:	c3                   	ret    

00101480 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
  101480:	f3 0f 1e fb          	endbr32 
  101484:	55                   	push   %ebp
  101485:	89 e5                	mov    %esp,%ebp
  101487:	83 ec 10             	sub    $0x10,%esp
  10148a:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  101490:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  101494:	89 c2                	mov    %eax,%edx
  101496:	ec                   	in     (%dx),%al
  101497:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  10149a:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
  10149e:	0f b6 c0             	movzbl %al,%eax
  1014a1:	83 e0 01             	and    $0x1,%eax
  1014a4:	85 c0                	test   %eax,%eax
  1014a6:	75 07                	jne    1014af <serial_proc_data+0x2f>
        return -1;
  1014a8:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  1014ad:	eb 2a                	jmp    1014d9 <serial_proc_data+0x59>
  1014af:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1014b5:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  1014b9:	89 c2                	mov    %eax,%edx
  1014bb:	ec                   	in     (%dx),%al
  1014bc:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
  1014bf:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
  1014c3:	0f b6 c0             	movzbl %al,%eax
  1014c6:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
  1014c9:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
  1014cd:	75 07                	jne    1014d6 <serial_proc_data+0x56>
        c = '\b';
  1014cf:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
  1014d6:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1014d9:	c9                   	leave  
  1014da:	c3                   	ret    

001014db <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
  1014db:	f3 0f 1e fb          	endbr32 
  1014df:	55                   	push   %ebp
  1014e0:	89 e5                	mov    %esp,%ebp
  1014e2:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
  1014e5:	a1 48 64 12 00       	mov    0x126448,%eax
  1014ea:	85 c0                	test   %eax,%eax
  1014ec:	74 0c                	je     1014fa <serial_intr+0x1f>
        cons_intr(serial_proc_data);
  1014ee:	c7 04 24 80 14 10 00 	movl   $0x101480,(%esp)
  1014f5:	e8 35 ff ff ff       	call   10142f <cons_intr>
    }
}
  1014fa:	90                   	nop
  1014fb:	c9                   	leave  
  1014fc:	c3                   	ret    

001014fd <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
  1014fd:	f3 0f 1e fb          	endbr32 
  101501:	55                   	push   %ebp
  101502:	89 e5                	mov    %esp,%ebp
  101504:	83 ec 38             	sub    $0x38,%esp
  101507:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  10150d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101510:	89 c2                	mov    %eax,%edx
  101512:	ec                   	in     (%dx),%al
  101513:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
  101516:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
  10151a:	0f b6 c0             	movzbl %al,%eax
  10151d:	83 e0 01             	and    $0x1,%eax
  101520:	85 c0                	test   %eax,%eax
  101522:	75 0a                	jne    10152e <kbd_proc_data+0x31>
        return -1;
  101524:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  101529:	e9 56 01 00 00       	jmp    101684 <kbd_proc_data+0x187>
  10152e:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  101534:	8b 45 ec             	mov    -0x14(%ebp),%eax
  101537:	89 c2                	mov    %eax,%edx
  101539:	ec                   	in     (%dx),%al
  10153a:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
  10153d:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
  101541:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
  101544:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
  101548:	75 17                	jne    101561 <kbd_proc_data+0x64>
        // E0 escape character
        shift |= E0ESC;
  10154a:	a1 68 66 12 00       	mov    0x126668,%eax
  10154f:	83 c8 40             	or     $0x40,%eax
  101552:	a3 68 66 12 00       	mov    %eax,0x126668
        return 0;
  101557:	b8 00 00 00 00       	mov    $0x0,%eax
  10155c:	e9 23 01 00 00       	jmp    101684 <kbd_proc_data+0x187>
    } else if (data & 0x80) {
  101561:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101565:	84 c0                	test   %al,%al
  101567:	79 45                	jns    1015ae <kbd_proc_data+0xb1>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
  101569:	a1 68 66 12 00       	mov    0x126668,%eax
  10156e:	83 e0 40             	and    $0x40,%eax
  101571:	85 c0                	test   %eax,%eax
  101573:	75 08                	jne    10157d <kbd_proc_data+0x80>
  101575:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101579:	24 7f                	and    $0x7f,%al
  10157b:	eb 04                	jmp    101581 <kbd_proc_data+0x84>
  10157d:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101581:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
  101584:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101588:	0f b6 80 40 30 12 00 	movzbl 0x123040(%eax),%eax
  10158f:	0c 40                	or     $0x40,%al
  101591:	0f b6 c0             	movzbl %al,%eax
  101594:	f7 d0                	not    %eax
  101596:	89 c2                	mov    %eax,%edx
  101598:	a1 68 66 12 00       	mov    0x126668,%eax
  10159d:	21 d0                	and    %edx,%eax
  10159f:	a3 68 66 12 00       	mov    %eax,0x126668
        return 0;
  1015a4:	b8 00 00 00 00       	mov    $0x0,%eax
  1015a9:	e9 d6 00 00 00       	jmp    101684 <kbd_proc_data+0x187>
    } else if (shift & E0ESC) {
  1015ae:	a1 68 66 12 00       	mov    0x126668,%eax
  1015b3:	83 e0 40             	and    $0x40,%eax
  1015b6:	85 c0                	test   %eax,%eax
  1015b8:	74 11                	je     1015cb <kbd_proc_data+0xce>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
  1015ba:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
  1015be:	a1 68 66 12 00       	mov    0x126668,%eax
  1015c3:	83 e0 bf             	and    $0xffffffbf,%eax
  1015c6:	a3 68 66 12 00       	mov    %eax,0x126668
    }

    shift |= shiftcode[data];
  1015cb:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1015cf:	0f b6 80 40 30 12 00 	movzbl 0x123040(%eax),%eax
  1015d6:	0f b6 d0             	movzbl %al,%edx
  1015d9:	a1 68 66 12 00       	mov    0x126668,%eax
  1015de:	09 d0                	or     %edx,%eax
  1015e0:	a3 68 66 12 00       	mov    %eax,0x126668
    shift ^= togglecode[data];
  1015e5:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1015e9:	0f b6 80 40 31 12 00 	movzbl 0x123140(%eax),%eax
  1015f0:	0f b6 d0             	movzbl %al,%edx
  1015f3:	a1 68 66 12 00       	mov    0x126668,%eax
  1015f8:	31 d0                	xor    %edx,%eax
  1015fa:	a3 68 66 12 00       	mov    %eax,0x126668

    c = charcode[shift & (CTL | SHIFT)][data];
  1015ff:	a1 68 66 12 00       	mov    0x126668,%eax
  101604:	83 e0 03             	and    $0x3,%eax
  101607:	8b 14 85 40 35 12 00 	mov    0x123540(,%eax,4),%edx
  10160e:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101612:	01 d0                	add    %edx,%eax
  101614:	0f b6 00             	movzbl (%eax),%eax
  101617:	0f b6 c0             	movzbl %al,%eax
  10161a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
  10161d:	a1 68 66 12 00       	mov    0x126668,%eax
  101622:	83 e0 08             	and    $0x8,%eax
  101625:	85 c0                	test   %eax,%eax
  101627:	74 22                	je     10164b <kbd_proc_data+0x14e>
        if ('a' <= c && c <= 'z')
  101629:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
  10162d:	7e 0c                	jle    10163b <kbd_proc_data+0x13e>
  10162f:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
  101633:	7f 06                	jg     10163b <kbd_proc_data+0x13e>
            c += 'A' - 'a';
  101635:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
  101639:	eb 10                	jmp    10164b <kbd_proc_data+0x14e>
        else if ('A' <= c && c <= 'Z')
  10163b:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
  10163f:	7e 0a                	jle    10164b <kbd_proc_data+0x14e>
  101641:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
  101645:	7f 04                	jg     10164b <kbd_proc_data+0x14e>
            c += 'a' - 'A';
  101647:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
  10164b:	a1 68 66 12 00       	mov    0x126668,%eax
  101650:	f7 d0                	not    %eax
  101652:	83 e0 06             	and    $0x6,%eax
  101655:	85 c0                	test   %eax,%eax
  101657:	75 28                	jne    101681 <kbd_proc_data+0x184>
  101659:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
  101660:	75 1f                	jne    101681 <kbd_proc_data+0x184>
        cprintf("Rebooting!\n");
  101662:	c7 04 24 85 98 10 00 	movl   $0x109885,(%esp)
  101669:	e8 47 ec ff ff       	call   1002b5 <cprintf>
  10166e:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
  101674:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101678:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
  10167c:	8b 55 e8             	mov    -0x18(%ebp),%edx
  10167f:	ee                   	out    %al,(%dx)
}
  101680:	90                   	nop
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
  101681:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  101684:	c9                   	leave  
  101685:	c3                   	ret    

00101686 <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
  101686:	f3 0f 1e fb          	endbr32 
  10168a:	55                   	push   %ebp
  10168b:	89 e5                	mov    %esp,%ebp
  10168d:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
  101690:	c7 04 24 fd 14 10 00 	movl   $0x1014fd,(%esp)
  101697:	e8 93 fd ff ff       	call   10142f <cons_intr>
}
  10169c:	90                   	nop
  10169d:	c9                   	leave  
  10169e:	c3                   	ret    

0010169f <kbd_init>:

static void
kbd_init(void) {
  10169f:	f3 0f 1e fb          	endbr32 
  1016a3:	55                   	push   %ebp
  1016a4:	89 e5                	mov    %esp,%ebp
  1016a6:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
  1016a9:	e8 d8 ff ff ff       	call   101686 <kbd_intr>
    pic_enable(IRQ_KBD);
  1016ae:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1016b5:	e8 47 01 00 00       	call   101801 <pic_enable>
}
  1016ba:	90                   	nop
  1016bb:	c9                   	leave  
  1016bc:	c3                   	ret    

001016bd <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
  1016bd:	f3 0f 1e fb          	endbr32 
  1016c1:	55                   	push   %ebp
  1016c2:	89 e5                	mov    %esp,%ebp
  1016c4:	83 ec 18             	sub    $0x18,%esp
    cga_init();
  1016c7:	e8 2e f8 ff ff       	call   100efa <cga_init>
    serial_init();
  1016cc:	e8 13 f9 ff ff       	call   100fe4 <serial_init>
    kbd_init();
  1016d1:	e8 c9 ff ff ff       	call   10169f <kbd_init>
    if (!serial_exists) {
  1016d6:	a1 48 64 12 00       	mov    0x126448,%eax
  1016db:	85 c0                	test   %eax,%eax
  1016dd:	75 0c                	jne    1016eb <cons_init+0x2e>
        cprintf("serial port does not exist!!\n");
  1016df:	c7 04 24 91 98 10 00 	movl   $0x109891,(%esp)
  1016e6:	e8 ca eb ff ff       	call   1002b5 <cprintf>
    }
}
  1016eb:	90                   	nop
  1016ec:	c9                   	leave  
  1016ed:	c3                   	ret    

001016ee <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
  1016ee:	f3 0f 1e fb          	endbr32 
  1016f2:	55                   	push   %ebp
  1016f3:	89 e5                	mov    %esp,%ebp
  1016f5:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
  1016f8:	e8 72 f7 ff ff       	call   100e6f <__intr_save>
  1016fd:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
  101700:	8b 45 08             	mov    0x8(%ebp),%eax
  101703:	89 04 24             	mov    %eax,(%esp)
  101706:	e8 48 fa ff ff       	call   101153 <lpt_putc>
        cga_putc(c);
  10170b:	8b 45 08             	mov    0x8(%ebp),%eax
  10170e:	89 04 24             	mov    %eax,(%esp)
  101711:	e8 81 fa ff ff       	call   101197 <cga_putc>
        serial_putc(c);
  101716:	8b 45 08             	mov    0x8(%ebp),%eax
  101719:	89 04 24             	mov    %eax,(%esp)
  10171c:	e8 ca fc ff ff       	call   1013eb <serial_putc>
    }
    local_intr_restore(intr_flag);
  101721:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101724:	89 04 24             	mov    %eax,(%esp)
  101727:	e8 6d f7 ff ff       	call   100e99 <__intr_restore>
}
  10172c:	90                   	nop
  10172d:	c9                   	leave  
  10172e:	c3                   	ret    

0010172f <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
  10172f:	f3 0f 1e fb          	endbr32 
  101733:	55                   	push   %ebp
  101734:	89 e5                	mov    %esp,%ebp
  101736:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
  101739:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
  101740:	e8 2a f7 ff ff       	call   100e6f <__intr_save>
  101745:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
  101748:	e8 8e fd ff ff       	call   1014db <serial_intr>
        kbd_intr();
  10174d:	e8 34 ff ff ff       	call   101686 <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
  101752:	8b 15 60 66 12 00    	mov    0x126660,%edx
  101758:	a1 64 66 12 00       	mov    0x126664,%eax
  10175d:	39 c2                	cmp    %eax,%edx
  10175f:	74 31                	je     101792 <cons_getc+0x63>
            c = cons.buf[cons.rpos ++];
  101761:	a1 60 66 12 00       	mov    0x126660,%eax
  101766:	8d 50 01             	lea    0x1(%eax),%edx
  101769:	89 15 60 66 12 00    	mov    %edx,0x126660
  10176f:	0f b6 80 60 64 12 00 	movzbl 0x126460(%eax),%eax
  101776:	0f b6 c0             	movzbl %al,%eax
  101779:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
  10177c:	a1 60 66 12 00       	mov    0x126660,%eax
  101781:	3d 00 02 00 00       	cmp    $0x200,%eax
  101786:	75 0a                	jne    101792 <cons_getc+0x63>
                cons.rpos = 0;
  101788:	c7 05 60 66 12 00 00 	movl   $0x0,0x126660
  10178f:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
  101792:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101795:	89 04 24             	mov    %eax,(%esp)
  101798:	e8 fc f6 ff ff       	call   100e99 <__intr_restore>
    return c;
  10179d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  1017a0:	c9                   	leave  
  1017a1:	c3                   	ret    

001017a2 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
  1017a2:	f3 0f 1e fb          	endbr32 
  1017a6:	55                   	push   %ebp
  1017a7:	89 e5                	mov    %esp,%ebp
  1017a9:	83 ec 14             	sub    $0x14,%esp
  1017ac:	8b 45 08             	mov    0x8(%ebp),%eax
  1017af:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
  1017b3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1017b6:	66 a3 50 35 12 00    	mov    %ax,0x123550
    if (did_init) {
  1017bc:	a1 6c 66 12 00       	mov    0x12666c,%eax
  1017c1:	85 c0                	test   %eax,%eax
  1017c3:	74 39                	je     1017fe <pic_setmask+0x5c>
        outb(IO_PIC1 + 1, mask);
  1017c5:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1017c8:	0f b6 c0             	movzbl %al,%eax
  1017cb:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
  1017d1:	88 45 f9             	mov    %al,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017d4:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  1017d8:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  1017dc:	ee                   	out    %al,(%dx)
}
  1017dd:	90                   	nop
        outb(IO_PIC2 + 1, mask >> 8);
  1017de:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
  1017e2:	c1 e8 08             	shr    $0x8,%eax
  1017e5:	0f b7 c0             	movzwl %ax,%eax
  1017e8:	0f b6 c0             	movzbl %al,%eax
  1017eb:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
  1017f1:	88 45 fd             	mov    %al,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017f4:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
  1017f8:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
  1017fc:	ee                   	out    %al,(%dx)
}
  1017fd:	90                   	nop
    }
}
  1017fe:	90                   	nop
  1017ff:	c9                   	leave  
  101800:	c3                   	ret    

00101801 <pic_enable>:

void
pic_enable(unsigned int irq) {
  101801:	f3 0f 1e fb          	endbr32 
  101805:	55                   	push   %ebp
  101806:	89 e5                	mov    %esp,%ebp
  101808:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
  10180b:	8b 45 08             	mov    0x8(%ebp),%eax
  10180e:	ba 01 00 00 00       	mov    $0x1,%edx
  101813:	88 c1                	mov    %al,%cl
  101815:	d3 e2                	shl    %cl,%edx
  101817:	89 d0                	mov    %edx,%eax
  101819:	98                   	cwtl   
  10181a:	f7 d0                	not    %eax
  10181c:	0f bf d0             	movswl %ax,%edx
  10181f:	0f b7 05 50 35 12 00 	movzwl 0x123550,%eax
  101826:	98                   	cwtl   
  101827:	21 d0                	and    %edx,%eax
  101829:	98                   	cwtl   
  10182a:	0f b7 c0             	movzwl %ax,%eax
  10182d:	89 04 24             	mov    %eax,(%esp)
  101830:	e8 6d ff ff ff       	call   1017a2 <pic_setmask>
}
  101835:	90                   	nop
  101836:	c9                   	leave  
  101837:	c3                   	ret    

00101838 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
  101838:	f3 0f 1e fb          	endbr32 
  10183c:	55                   	push   %ebp
  10183d:	89 e5                	mov    %esp,%ebp
  10183f:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
  101842:	c7 05 6c 66 12 00 01 	movl   $0x1,0x12666c
  101849:	00 00 00 
  10184c:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
  101852:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101856:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
  10185a:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
  10185e:	ee                   	out    %al,(%dx)
}
  10185f:	90                   	nop
  101860:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
  101866:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10186a:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
  10186e:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
  101872:	ee                   	out    %al,(%dx)
}
  101873:	90                   	nop
  101874:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
  10187a:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10187e:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
  101882:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
  101886:	ee                   	out    %al,(%dx)
}
  101887:	90                   	nop
  101888:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
  10188e:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101892:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
  101896:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  10189a:	ee                   	out    %al,(%dx)
}
  10189b:	90                   	nop
  10189c:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
  1018a2:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1018a6:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
  1018aa:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
  1018ae:	ee                   	out    %al,(%dx)
}
  1018af:	90                   	nop
  1018b0:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
  1018b6:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1018ba:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
  1018be:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  1018c2:	ee                   	out    %al,(%dx)
}
  1018c3:	90                   	nop
  1018c4:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
  1018ca:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1018ce:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
  1018d2:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
  1018d6:	ee                   	out    %al,(%dx)
}
  1018d7:	90                   	nop
  1018d8:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
  1018de:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1018e2:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  1018e6:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  1018ea:	ee                   	out    %al,(%dx)
}
  1018eb:	90                   	nop
  1018ec:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
  1018f2:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1018f6:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  1018fa:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  1018fe:	ee                   	out    %al,(%dx)
}
  1018ff:	90                   	nop
  101900:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
  101906:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10190a:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  10190e:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  101912:	ee                   	out    %al,(%dx)
}
  101913:	90                   	nop
  101914:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
  10191a:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10191e:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  101922:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  101926:	ee                   	out    %al,(%dx)
}
  101927:	90                   	nop
  101928:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
  10192e:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101932:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  101936:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  10193a:	ee                   	out    %al,(%dx)
}
  10193b:	90                   	nop
  10193c:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
  101942:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101946:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  10194a:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  10194e:	ee                   	out    %al,(%dx)
}
  10194f:	90                   	nop
  101950:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
  101956:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10195a:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
  10195e:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
  101962:	ee                   	out    %al,(%dx)
}
  101963:	90                   	nop
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
  101964:	0f b7 05 50 35 12 00 	movzwl 0x123550,%eax
  10196b:	3d ff ff 00 00       	cmp    $0xffff,%eax
  101970:	74 0f                	je     101981 <pic_init+0x149>
        pic_setmask(irq_mask);
  101972:	0f b7 05 50 35 12 00 	movzwl 0x123550,%eax
  101979:	89 04 24             	mov    %eax,(%esp)
  10197c:	e8 21 fe ff ff       	call   1017a2 <pic_setmask>
    }
}
  101981:	90                   	nop
  101982:	c9                   	leave  
  101983:	c3                   	ret    

00101984 <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
  101984:	f3 0f 1e fb          	endbr32 
  101988:	55                   	push   %ebp
  101989:	89 e5                	mov    %esp,%ebp
    asm volatile ("sti");
  10198b:	fb                   	sti    
}
  10198c:	90                   	nop
    sti();
}
  10198d:	90                   	nop
  10198e:	5d                   	pop    %ebp
  10198f:	c3                   	ret    

00101990 <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
  101990:	f3 0f 1e fb          	endbr32 
  101994:	55                   	push   %ebp
  101995:	89 e5                	mov    %esp,%ebp
    asm volatile ("cli" ::: "memory");
  101997:	fa                   	cli    
}
  101998:	90                   	nop
    cli();
}
  101999:	90                   	nop
  10199a:	5d                   	pop    %ebp
  10199b:	c3                   	ret    

0010199c <print_ticks>:
#include <console.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
  10199c:	f3 0f 1e fb          	endbr32 
  1019a0:	55                   	push   %ebp
  1019a1:	89 e5                	mov    %esp,%ebp
  1019a3:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
  1019a6:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
  1019ad:	00 
  1019ae:	c7 04 24 c0 98 10 00 	movl   $0x1098c0,(%esp)
  1019b5:	e8 fb e8 ff ff       	call   1002b5 <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
  1019ba:	90                   	nop
  1019bb:	c9                   	leave  
  1019bc:	c3                   	ret    

001019bd <idt_init>:
extern uintptr_t __vectors[];
struct trapframe *switchu2k,*newtf;
uint32_t esp0;
/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
  1019bd:	f3 0f 1e fb          	endbr32 
  1019c1:	55                   	push   %ebp
  1019c2:	89 e5                	mov    %esp,%ebp
  1019c4:	83 ec 10             	sub    $0x10,%esp
      *     Can you see idt[256] in this file? Yes, it's IDT! you can use SETGATE macro to setup each item of IDT
      * (3) After setup the contents of IDT, you will let CPU know where is the IDT by using 'lidt' instruction.
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
      int isr = 0;
  1019c7:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
      for(; isr < 256; isr++) 
  1019ce:	e9 c4 00 00 00       	jmp    101a97 <idt_init+0xda>
      	SETGATE(idt[isr], 0, KERNEL_CS, __vectors[isr], DPL_KERNEL);
  1019d3:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1019d6:	8b 04 85 e0 35 12 00 	mov    0x1235e0(,%eax,4),%eax
  1019dd:	0f b7 d0             	movzwl %ax,%edx
  1019e0:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1019e3:	66 89 14 c5 80 66 12 	mov    %dx,0x126680(,%eax,8)
  1019ea:	00 
  1019eb:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1019ee:	66 c7 04 c5 82 66 12 	movw   $0x8,0x126682(,%eax,8)
  1019f5:	00 08 00 
  1019f8:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1019fb:	0f b6 14 c5 84 66 12 	movzbl 0x126684(,%eax,8),%edx
  101a02:	00 
  101a03:	80 e2 e0             	and    $0xe0,%dl
  101a06:	88 14 c5 84 66 12 00 	mov    %dl,0x126684(,%eax,8)
  101a0d:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a10:	0f b6 14 c5 84 66 12 	movzbl 0x126684(,%eax,8),%edx
  101a17:	00 
  101a18:	80 e2 1f             	and    $0x1f,%dl
  101a1b:	88 14 c5 84 66 12 00 	mov    %dl,0x126684(,%eax,8)
  101a22:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a25:	0f b6 14 c5 85 66 12 	movzbl 0x126685(,%eax,8),%edx
  101a2c:	00 
  101a2d:	80 e2 f0             	and    $0xf0,%dl
  101a30:	80 ca 0e             	or     $0xe,%dl
  101a33:	88 14 c5 85 66 12 00 	mov    %dl,0x126685(,%eax,8)
  101a3a:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a3d:	0f b6 14 c5 85 66 12 	movzbl 0x126685(,%eax,8),%edx
  101a44:	00 
  101a45:	80 e2 ef             	and    $0xef,%dl
  101a48:	88 14 c5 85 66 12 00 	mov    %dl,0x126685(,%eax,8)
  101a4f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a52:	0f b6 14 c5 85 66 12 	movzbl 0x126685(,%eax,8),%edx
  101a59:	00 
  101a5a:	80 e2 9f             	and    $0x9f,%dl
  101a5d:	88 14 c5 85 66 12 00 	mov    %dl,0x126685(,%eax,8)
  101a64:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a67:	0f b6 14 c5 85 66 12 	movzbl 0x126685(,%eax,8),%edx
  101a6e:	00 
  101a6f:	80 ca 80             	or     $0x80,%dl
  101a72:	88 14 c5 85 66 12 00 	mov    %dl,0x126685(,%eax,8)
  101a79:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a7c:	8b 04 85 e0 35 12 00 	mov    0x1235e0(,%eax,4),%eax
  101a83:	c1 e8 10             	shr    $0x10,%eax
  101a86:	0f b7 d0             	movzwl %ax,%edx
  101a89:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101a8c:	66 89 14 c5 86 66 12 	mov    %dx,0x126686(,%eax,8)
  101a93:	00 
      for(; isr < 256; isr++) 
  101a94:	ff 45 fc             	incl   -0x4(%ebp)
  101a97:	81 7d fc ff 00 00 00 	cmpl   $0xff,-0x4(%ebp)
  101a9e:	0f 8e 2f ff ff ff    	jle    1019d3 <idt_init+0x16>
      SETGATE(idt[T_SWITCH_TOK], 0, GD_KTEXT, __vectors[T_SWITCH_TOK], DPL_USER);
  101aa4:	a1 c4 37 12 00       	mov    0x1237c4,%eax
  101aa9:	0f b7 c0             	movzwl %ax,%eax
  101aac:	66 a3 48 6a 12 00    	mov    %ax,0x126a48
  101ab2:	66 c7 05 4a 6a 12 00 	movw   $0x8,0x126a4a
  101ab9:	08 00 
  101abb:	0f b6 05 4c 6a 12 00 	movzbl 0x126a4c,%eax
  101ac2:	24 e0                	and    $0xe0,%al
  101ac4:	a2 4c 6a 12 00       	mov    %al,0x126a4c
  101ac9:	0f b6 05 4c 6a 12 00 	movzbl 0x126a4c,%eax
  101ad0:	24 1f                	and    $0x1f,%al
  101ad2:	a2 4c 6a 12 00       	mov    %al,0x126a4c
  101ad7:	0f b6 05 4d 6a 12 00 	movzbl 0x126a4d,%eax
  101ade:	24 f0                	and    $0xf0,%al
  101ae0:	0c 0e                	or     $0xe,%al
  101ae2:	a2 4d 6a 12 00       	mov    %al,0x126a4d
  101ae7:	0f b6 05 4d 6a 12 00 	movzbl 0x126a4d,%eax
  101aee:	24 ef                	and    $0xef,%al
  101af0:	a2 4d 6a 12 00       	mov    %al,0x126a4d
  101af5:	0f b6 05 4d 6a 12 00 	movzbl 0x126a4d,%eax
  101afc:	0c 60                	or     $0x60,%al
  101afe:	a2 4d 6a 12 00       	mov    %al,0x126a4d
  101b03:	0f b6 05 4d 6a 12 00 	movzbl 0x126a4d,%eax
  101b0a:	0c 80                	or     $0x80,%al
  101b0c:	a2 4d 6a 12 00       	mov    %al,0x126a4d
  101b11:	a1 c4 37 12 00       	mov    0x1237c4,%eax
  101b16:	c1 e8 10             	shr    $0x10,%eax
  101b19:	0f b7 c0             	movzwl %ax,%eax
  101b1c:	66 a3 4e 6a 12 00    	mov    %ax,0x126a4e
      SETGATE(idt[T_SYSCALL], 1, KERNEL_CS, __vectors[T_SYSCALL], DPL_USER);
  101b22:	a1 e0 37 12 00       	mov    0x1237e0,%eax
  101b27:	0f b7 c0             	movzwl %ax,%eax
  101b2a:	66 a3 80 6a 12 00    	mov    %ax,0x126a80
  101b30:	66 c7 05 82 6a 12 00 	movw   $0x8,0x126a82
  101b37:	08 00 
  101b39:	0f b6 05 84 6a 12 00 	movzbl 0x126a84,%eax
  101b40:	24 e0                	and    $0xe0,%al
  101b42:	a2 84 6a 12 00       	mov    %al,0x126a84
  101b47:	0f b6 05 84 6a 12 00 	movzbl 0x126a84,%eax
  101b4e:	24 1f                	and    $0x1f,%al
  101b50:	a2 84 6a 12 00       	mov    %al,0x126a84
  101b55:	0f b6 05 85 6a 12 00 	movzbl 0x126a85,%eax
  101b5c:	0c 0f                	or     $0xf,%al
  101b5e:	a2 85 6a 12 00       	mov    %al,0x126a85
  101b63:	0f b6 05 85 6a 12 00 	movzbl 0x126a85,%eax
  101b6a:	24 ef                	and    $0xef,%al
  101b6c:	a2 85 6a 12 00       	mov    %al,0x126a85
  101b71:	0f b6 05 85 6a 12 00 	movzbl 0x126a85,%eax
  101b78:	0c 60                	or     $0x60,%al
  101b7a:	a2 85 6a 12 00       	mov    %al,0x126a85
  101b7f:	0f b6 05 85 6a 12 00 	movzbl 0x126a85,%eax
  101b86:	0c 80                	or     $0x80,%al
  101b88:	a2 85 6a 12 00       	mov    %al,0x126a85
  101b8d:	a1 e0 37 12 00       	mov    0x1237e0,%eax
  101b92:	c1 e8 10             	shr    $0x10,%eax
  101b95:	0f b7 c0             	movzwl %ax,%eax
  101b98:	66 a3 86 6a 12 00    	mov    %ax,0x126a86
  101b9e:	c7 45 f8 60 35 12 00 	movl   $0x123560,-0x8(%ebp)
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
  101ba5:	8b 45 f8             	mov    -0x8(%ebp),%eax
  101ba8:	0f 01 18             	lidtl  (%eax)
}
  101bab:	90                   	nop
      lidt(&idt_pd);
}
  101bac:	90                   	nop
  101bad:	c9                   	leave  
  101bae:	c3                   	ret    

00101baf <trapname>:

static const char *
trapname(int trapno) {
  101baf:	f3 0f 1e fb          	endbr32 
  101bb3:	55                   	push   %ebp
  101bb4:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
  101bb6:	8b 45 08             	mov    0x8(%ebp),%eax
  101bb9:	83 f8 13             	cmp    $0x13,%eax
  101bbc:	77 0c                	ja     101bca <trapname+0x1b>
        return excnames[trapno];
  101bbe:	8b 45 08             	mov    0x8(%ebp),%eax
  101bc1:	8b 04 85 00 9c 10 00 	mov    0x109c00(,%eax,4),%eax
  101bc8:	eb 18                	jmp    101be2 <trapname+0x33>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
  101bca:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
  101bce:	7e 0d                	jle    101bdd <trapname+0x2e>
  101bd0:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
  101bd4:	7f 07                	jg     101bdd <trapname+0x2e>
        return "Hardware Interrupt";
  101bd6:	b8 ca 98 10 00       	mov    $0x1098ca,%eax
  101bdb:	eb 05                	jmp    101be2 <trapname+0x33>
    }
    return "(unknown trap)";
  101bdd:	b8 dd 98 10 00       	mov    $0x1098dd,%eax
}
  101be2:	5d                   	pop    %ebp
  101be3:	c3                   	ret    

00101be4 <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
  101be4:	f3 0f 1e fb          	endbr32 
  101be8:	55                   	push   %ebp
  101be9:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
  101beb:	8b 45 08             	mov    0x8(%ebp),%eax
  101bee:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101bf2:	83 f8 08             	cmp    $0x8,%eax
  101bf5:	0f 94 c0             	sete   %al
  101bf8:	0f b6 c0             	movzbl %al,%eax
}
  101bfb:	5d                   	pop    %ebp
  101bfc:	c3                   	ret    

00101bfd <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
  101bfd:	f3 0f 1e fb          	endbr32 
  101c01:	55                   	push   %ebp
  101c02:	89 e5                	mov    %esp,%ebp
  101c04:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
  101c07:	8b 45 08             	mov    0x8(%ebp),%eax
  101c0a:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c0e:	c7 04 24 1e 99 10 00 	movl   $0x10991e,(%esp)
  101c15:	e8 9b e6 ff ff       	call   1002b5 <cprintf>
    print_regs(&tf->tf_regs);
  101c1a:	8b 45 08             	mov    0x8(%ebp),%eax
  101c1d:	89 04 24             	mov    %eax,(%esp)
  101c20:	e8 8d 01 00 00       	call   101db2 <print_regs>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
  101c25:	8b 45 08             	mov    0x8(%ebp),%eax
  101c28:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
  101c2c:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c30:	c7 04 24 2f 99 10 00 	movl   $0x10992f,(%esp)
  101c37:	e8 79 e6 ff ff       	call   1002b5 <cprintf>
    cprintf("  es   0x----%04x\n", tf->tf_es);
  101c3c:	8b 45 08             	mov    0x8(%ebp),%eax
  101c3f:	0f b7 40 28          	movzwl 0x28(%eax),%eax
  101c43:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c47:	c7 04 24 42 99 10 00 	movl   $0x109942,(%esp)
  101c4e:	e8 62 e6 ff ff       	call   1002b5 <cprintf>
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
  101c53:	8b 45 08             	mov    0x8(%ebp),%eax
  101c56:	0f b7 40 24          	movzwl 0x24(%eax),%eax
  101c5a:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c5e:	c7 04 24 55 99 10 00 	movl   $0x109955,(%esp)
  101c65:	e8 4b e6 ff ff       	call   1002b5 <cprintf>
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
  101c6a:	8b 45 08             	mov    0x8(%ebp),%eax
  101c6d:	0f b7 40 20          	movzwl 0x20(%eax),%eax
  101c71:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c75:	c7 04 24 68 99 10 00 	movl   $0x109968,(%esp)
  101c7c:	e8 34 e6 ff ff       	call   1002b5 <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
  101c81:	8b 45 08             	mov    0x8(%ebp),%eax
  101c84:	8b 40 30             	mov    0x30(%eax),%eax
  101c87:	89 04 24             	mov    %eax,(%esp)
  101c8a:	e8 20 ff ff ff       	call   101baf <trapname>
  101c8f:	8b 55 08             	mov    0x8(%ebp),%edx
  101c92:	8b 52 30             	mov    0x30(%edx),%edx
  101c95:	89 44 24 08          	mov    %eax,0x8(%esp)
  101c99:	89 54 24 04          	mov    %edx,0x4(%esp)
  101c9d:	c7 04 24 7b 99 10 00 	movl   $0x10997b,(%esp)
  101ca4:	e8 0c e6 ff ff       	call   1002b5 <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
  101ca9:	8b 45 08             	mov    0x8(%ebp),%eax
  101cac:	8b 40 34             	mov    0x34(%eax),%eax
  101caf:	89 44 24 04          	mov    %eax,0x4(%esp)
  101cb3:	c7 04 24 8d 99 10 00 	movl   $0x10998d,(%esp)
  101cba:	e8 f6 e5 ff ff       	call   1002b5 <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
  101cbf:	8b 45 08             	mov    0x8(%ebp),%eax
  101cc2:	8b 40 38             	mov    0x38(%eax),%eax
  101cc5:	89 44 24 04          	mov    %eax,0x4(%esp)
  101cc9:	c7 04 24 9c 99 10 00 	movl   $0x10999c,(%esp)
  101cd0:	e8 e0 e5 ff ff       	call   1002b5 <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
  101cd5:	8b 45 08             	mov    0x8(%ebp),%eax
  101cd8:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101cdc:	89 44 24 04          	mov    %eax,0x4(%esp)
  101ce0:	c7 04 24 ab 99 10 00 	movl   $0x1099ab,(%esp)
  101ce7:	e8 c9 e5 ff ff       	call   1002b5 <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
  101cec:	8b 45 08             	mov    0x8(%ebp),%eax
  101cef:	8b 40 40             	mov    0x40(%eax),%eax
  101cf2:	89 44 24 04          	mov    %eax,0x4(%esp)
  101cf6:	c7 04 24 be 99 10 00 	movl   $0x1099be,(%esp)
  101cfd:	e8 b3 e5 ff ff       	call   1002b5 <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
  101d02:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  101d09:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
  101d10:	eb 3d                	jmp    101d4f <print_trapframe+0x152>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
  101d12:	8b 45 08             	mov    0x8(%ebp),%eax
  101d15:	8b 50 40             	mov    0x40(%eax),%edx
  101d18:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101d1b:	21 d0                	and    %edx,%eax
  101d1d:	85 c0                	test   %eax,%eax
  101d1f:	74 28                	je     101d49 <print_trapframe+0x14c>
  101d21:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101d24:	8b 04 85 80 35 12 00 	mov    0x123580(,%eax,4),%eax
  101d2b:	85 c0                	test   %eax,%eax
  101d2d:	74 1a                	je     101d49 <print_trapframe+0x14c>
            cprintf("%s,", IA32flags[i]);
  101d2f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101d32:	8b 04 85 80 35 12 00 	mov    0x123580(,%eax,4),%eax
  101d39:	89 44 24 04          	mov    %eax,0x4(%esp)
  101d3d:	c7 04 24 cd 99 10 00 	movl   $0x1099cd,(%esp)
  101d44:	e8 6c e5 ff ff       	call   1002b5 <cprintf>
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
  101d49:	ff 45 f4             	incl   -0xc(%ebp)
  101d4c:	d1 65 f0             	shll   -0x10(%ebp)
  101d4f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101d52:	83 f8 17             	cmp    $0x17,%eax
  101d55:	76 bb                	jbe    101d12 <print_trapframe+0x115>
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
  101d57:	8b 45 08             	mov    0x8(%ebp),%eax
  101d5a:	8b 40 40             	mov    0x40(%eax),%eax
  101d5d:	c1 e8 0c             	shr    $0xc,%eax
  101d60:	83 e0 03             	and    $0x3,%eax
  101d63:	89 44 24 04          	mov    %eax,0x4(%esp)
  101d67:	c7 04 24 d1 99 10 00 	movl   $0x1099d1,(%esp)
  101d6e:	e8 42 e5 ff ff       	call   1002b5 <cprintf>

    if (!trap_in_kernel(tf)) {
  101d73:	8b 45 08             	mov    0x8(%ebp),%eax
  101d76:	89 04 24             	mov    %eax,(%esp)
  101d79:	e8 66 fe ff ff       	call   101be4 <trap_in_kernel>
  101d7e:	85 c0                	test   %eax,%eax
  101d80:	75 2d                	jne    101daf <print_trapframe+0x1b2>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
  101d82:	8b 45 08             	mov    0x8(%ebp),%eax
  101d85:	8b 40 44             	mov    0x44(%eax),%eax
  101d88:	89 44 24 04          	mov    %eax,0x4(%esp)
  101d8c:	c7 04 24 da 99 10 00 	movl   $0x1099da,(%esp)
  101d93:	e8 1d e5 ff ff       	call   1002b5 <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
  101d98:	8b 45 08             	mov    0x8(%ebp),%eax
  101d9b:	0f b7 40 48          	movzwl 0x48(%eax),%eax
  101d9f:	89 44 24 04          	mov    %eax,0x4(%esp)
  101da3:	c7 04 24 e9 99 10 00 	movl   $0x1099e9,(%esp)
  101daa:	e8 06 e5 ff ff       	call   1002b5 <cprintf>
    }
}
  101daf:	90                   	nop
  101db0:	c9                   	leave  
  101db1:	c3                   	ret    

00101db2 <print_regs>:

void
print_regs(struct pushregs *regs) {
  101db2:	f3 0f 1e fb          	endbr32 
  101db6:	55                   	push   %ebp
  101db7:	89 e5                	mov    %esp,%ebp
  101db9:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
  101dbc:	8b 45 08             	mov    0x8(%ebp),%eax
  101dbf:	8b 00                	mov    (%eax),%eax
  101dc1:	89 44 24 04          	mov    %eax,0x4(%esp)
  101dc5:	c7 04 24 fc 99 10 00 	movl   $0x1099fc,(%esp)
  101dcc:	e8 e4 e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
  101dd1:	8b 45 08             	mov    0x8(%ebp),%eax
  101dd4:	8b 40 04             	mov    0x4(%eax),%eax
  101dd7:	89 44 24 04          	mov    %eax,0x4(%esp)
  101ddb:	c7 04 24 0b 9a 10 00 	movl   $0x109a0b,(%esp)
  101de2:	e8 ce e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
  101de7:	8b 45 08             	mov    0x8(%ebp),%eax
  101dea:	8b 40 08             	mov    0x8(%eax),%eax
  101ded:	89 44 24 04          	mov    %eax,0x4(%esp)
  101df1:	c7 04 24 1a 9a 10 00 	movl   $0x109a1a,(%esp)
  101df8:	e8 b8 e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
  101dfd:	8b 45 08             	mov    0x8(%ebp),%eax
  101e00:	8b 40 0c             	mov    0xc(%eax),%eax
  101e03:	89 44 24 04          	mov    %eax,0x4(%esp)
  101e07:	c7 04 24 29 9a 10 00 	movl   $0x109a29,(%esp)
  101e0e:	e8 a2 e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
  101e13:	8b 45 08             	mov    0x8(%ebp),%eax
  101e16:	8b 40 10             	mov    0x10(%eax),%eax
  101e19:	89 44 24 04          	mov    %eax,0x4(%esp)
  101e1d:	c7 04 24 38 9a 10 00 	movl   $0x109a38,(%esp)
  101e24:	e8 8c e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
  101e29:	8b 45 08             	mov    0x8(%ebp),%eax
  101e2c:	8b 40 14             	mov    0x14(%eax),%eax
  101e2f:	89 44 24 04          	mov    %eax,0x4(%esp)
  101e33:	c7 04 24 47 9a 10 00 	movl   $0x109a47,(%esp)
  101e3a:	e8 76 e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
  101e3f:	8b 45 08             	mov    0x8(%ebp),%eax
  101e42:	8b 40 18             	mov    0x18(%eax),%eax
  101e45:	89 44 24 04          	mov    %eax,0x4(%esp)
  101e49:	c7 04 24 56 9a 10 00 	movl   $0x109a56,(%esp)
  101e50:	e8 60 e4 ff ff       	call   1002b5 <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
  101e55:	8b 45 08             	mov    0x8(%ebp),%eax
  101e58:	8b 40 1c             	mov    0x1c(%eax),%eax
  101e5b:	89 44 24 04          	mov    %eax,0x4(%esp)
  101e5f:	c7 04 24 65 9a 10 00 	movl   $0x109a65,(%esp)
  101e66:	e8 4a e4 ff ff       	call   1002b5 <cprintf>
}
  101e6b:	90                   	nop
  101e6c:	c9                   	leave  
  101e6d:	c3                   	ret    

00101e6e <trap_dispatch>:

/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
  101e6e:	f3 0f 1e fb          	endbr32 
  101e72:	55                   	push   %ebp
  101e73:	89 e5                	mov    %esp,%ebp
  101e75:	83 ec 28             	sub    $0x28,%esp
    char c;

    switch (tf->tf_trapno) {
  101e78:	8b 45 08             	mov    0x8(%ebp),%eax
  101e7b:	8b 40 30             	mov    0x30(%eax),%eax
  101e7e:	83 f8 79             	cmp    $0x79,%eax
  101e81:	0f 84 db 02 00 00    	je     102162 <trap_dispatch+0x2f4>
  101e87:	83 f8 79             	cmp    $0x79,%eax
  101e8a:	0f 87 4f 03 00 00    	ja     1021df <trap_dispatch+0x371>
  101e90:	83 f8 78             	cmp    $0x78,%eax
  101e93:	0f 84 00 02 00 00    	je     102099 <trap_dispatch+0x22b>
  101e99:	83 f8 78             	cmp    $0x78,%eax
  101e9c:	0f 87 3d 03 00 00    	ja     1021df <trap_dispatch+0x371>
  101ea2:	83 f8 24             	cmp    $0x24,%eax
  101ea5:	74 49                	je     101ef0 <trap_dispatch+0x82>
  101ea7:	83 f8 24             	cmp    $0x24,%eax
  101eaa:	0f 87 2f 03 00 00    	ja     1021df <trap_dispatch+0x371>
  101eb0:	83 f8 20             	cmp    $0x20,%eax
  101eb3:	74 0e                	je     101ec3 <trap_dispatch+0x55>
  101eb5:	83 f8 21             	cmp    $0x21,%eax
  101eb8:	0f 84 b7 01 00 00    	je     102075 <trap_dispatch+0x207>
  101ebe:	e9 1c 03 00 00       	jmp    1021df <trap_dispatch+0x371>
        /* handle the timer interrupt */
        /* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
        ticks ++;
  101ec3:	a1 a0 6f 12 00       	mov    0x126fa0,%eax
  101ec8:	40                   	inc    %eax
  101ec9:	a3 a0 6f 12 00       	mov    %eax,0x126fa0
        if (ticks == TICK_NUM)
  101ece:	a1 a0 6f 12 00       	mov    0x126fa0,%eax
  101ed3:	83 f8 64             	cmp    $0x64,%eax
  101ed6:	0f 85 38 03 00 00    	jne    102214 <trap_dispatch+0x3a6>
        {
            ticks = 0;
  101edc:	c7 05 a0 6f 12 00 00 	movl   $0x0,0x126fa0
  101ee3:	00 00 00 
            print_ticks();
  101ee6:	e8 b1 fa ff ff       	call   10199c <print_ticks>
        }
        break;
  101eeb:	e9 24 03 00 00       	jmp    102214 <trap_dispatch+0x3a6>
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
  101ef0:	e8 3a f8 ff ff       	call   10172f <cons_getc>
  101ef5:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("serial %c\n", c);
  101ef8:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  101efc:	89 44 24 04          	mov    %eax,0x4(%esp)
  101f00:	c7 04 24 74 9a 10 00 	movl   $0x109a74,(%esp)
  101f07:	e8 a9 e3 ff ff       	call   1002b5 <cprintf>
        switch(c)
  101f0c:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  101f10:	83 f8 30             	cmp    $0x30,%eax
  101f13:	74 0e                	je     101f23 <trap_dispatch+0xb5>
  101f15:	83 f8 33             	cmp    $0x33,%eax
  101f18:	0f 84 85 00 00 00    	je     101fa3 <trap_dispatch+0x135>
			newtf->tf_eflags |= FL_IOPL_MASK;
			*((uint32_t *)tf - 1) = (uint32_t)newtf;
		}
		break;
        }
        break;
  101f1e:	e9 f8 02 00 00       	jmp    10221b <trap_dispatch+0x3ad>
        	if (tf->tf_cs != KERNEL_CS) {
  101f23:	8b 45 08             	mov    0x8(%ebp),%eax
  101f26:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101f2a:	83 f8 08             	cmp    $0x8,%eax
  101f2d:	0f 84 36 01 00 00    	je     102069 <trap_dispatch+0x1fb>
            		tf->tf_cs = KERNEL_CS;
  101f33:	8b 45 08             	mov    0x8(%ebp),%eax
  101f36:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            		tf->tf_ds = tf->tf_es = KERNEL_DS;
  101f3c:	8b 45 08             	mov    0x8(%ebp),%eax
  101f3f:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
  101f45:	8b 45 08             	mov    0x8(%ebp),%eax
  101f48:	0f b7 50 28          	movzwl 0x28(%eax),%edx
  101f4c:	8b 45 08             	mov    0x8(%ebp),%eax
  101f4f:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            		tf->tf_eflags &= ~FL_IOPL_MASK;
  101f53:	8b 45 08             	mov    0x8(%ebp),%eax
  101f56:	8b 40 40             	mov    0x40(%eax),%eax
  101f59:	25 ff cf ff ff       	and    $0xffffcfff,%eax
  101f5e:	89 c2                	mov    %eax,%edx
  101f60:	8b 45 08             	mov    0x8(%ebp),%eax
  101f63:	89 50 40             	mov    %edx,0x40(%eax)
            		switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
  101f66:	8b 45 08             	mov    0x8(%ebp),%eax
  101f69:	8b 40 44             	mov    0x44(%eax),%eax
  101f6c:	83 e8 44             	sub    $0x44,%eax
  101f6f:	a3 ac 6f 12 00       	mov    %eax,0x126fac
            		memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
  101f74:	a1 ac 6f 12 00       	mov    0x126fac,%eax
  101f79:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  101f80:	00 
  101f81:	8b 55 08             	mov    0x8(%ebp),%edx
  101f84:	89 54 24 04          	mov    %edx,0x4(%esp)
  101f88:	89 04 24             	mov    %eax,(%esp)
  101f8b:	e8 91 6d 00 00       	call   108d21 <memmove>
            		*((uint32_t *)tf - 1) = (uint32_t)switchu2k;
  101f90:	8b 15 ac 6f 12 00    	mov    0x126fac,%edx
  101f96:	8b 45 08             	mov    0x8(%ebp),%eax
  101f99:	83 e8 04             	sub    $0x4,%eax
  101f9c:	89 10                	mov    %edx,(%eax)
        	break;
  101f9e:	e9 c6 00 00 00       	jmp    102069 <trap_dispatch+0x1fb>
        	asm volatile("movl %%esp, %0" : "=r" (esp0));
  101fa3:	89 e0                	mov    %esp,%eax
  101fa5:	a3 a4 6f 12 00       	mov    %eax,0x126fa4
		newtf=(struct trapframe *)(esp0-0x200);
  101faa:	a1 a4 6f 12 00       	mov    0x126fa4,%eax
  101faf:	2d 00 02 00 00       	sub    $0x200,%eax
  101fb4:	a3 a8 6f 12 00       	mov    %eax,0x126fa8
		if (trap_in_kernel(tf)) {
  101fb9:	8b 45 08             	mov    0x8(%ebp),%eax
  101fbc:	89 04 24             	mov    %eax,(%esp)
  101fbf:	e8 20 fc ff ff       	call   101be4 <trap_in_kernel>
  101fc4:	85 c0                	test   %eax,%eax
  101fc6:	0f 84 a3 00 00 00    	je     10206f <trap_dispatch+0x201>
			memmove(newtf, tf, sizeof(struct trapframe) - 8);
  101fcc:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  101fd1:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  101fd8:	00 
  101fd9:	8b 55 08             	mov    0x8(%ebp),%edx
  101fdc:	89 54 24 04          	mov    %edx,0x4(%esp)
  101fe0:	89 04 24             	mov    %eax,(%esp)
  101fe3:	e8 39 6d 00 00       	call   108d21 <memmove>
			newtf->tf_cs = USER_CS;
  101fe8:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  101fed:	66 c7 40 3c 1b 00    	movw   $0x1b,0x3c(%eax)
			newtf->tf_ss = newtf->tf_ds = newtf->tf_es = newtf->tf_gs = newtf->tf_fs = USER_DS;
  101ff3:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  101ff9:	66 c7 42 24 23 00    	movw   $0x23,0x24(%edx)
  101fff:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  102004:	0f b7 52 24          	movzwl 0x24(%edx),%edx
  102008:	66 89 50 20          	mov    %dx,0x20(%eax)
  10200c:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  102012:	0f b7 40 20          	movzwl 0x20(%eax),%eax
  102016:	66 89 42 28          	mov    %ax,0x28(%edx)
  10201a:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  10201f:	0f b7 52 28          	movzwl 0x28(%edx),%edx
  102023:	66 89 50 2c          	mov    %dx,0x2c(%eax)
  102027:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  10202d:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
  102031:	66 89 42 48          	mov    %ax,0x48(%edx)
			newtf->tf_esp = (uint32_t)tf + (sizeof(struct trapframe)-8);
  102035:	8b 55 08             	mov    0x8(%ebp),%edx
  102038:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  10203d:	83 c2 44             	add    $0x44,%edx
  102040:	89 50 44             	mov    %edx,0x44(%eax)
			newtf->tf_eflags |= FL_IOPL_MASK;
  102043:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  102048:	8b 50 40             	mov    0x40(%eax),%edx
  10204b:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  102050:	81 ca 00 30 00 00    	or     $0x3000,%edx
  102056:	89 50 40             	mov    %edx,0x40(%eax)
			*((uint32_t *)tf - 1) = (uint32_t)newtf;
  102059:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  10205f:	8b 45 08             	mov    0x8(%ebp),%eax
  102062:	83 e8 04             	sub    $0x4,%eax
  102065:	89 10                	mov    %edx,(%eax)
		break;
  102067:	eb 06                	jmp    10206f <trap_dispatch+0x201>
        	break;
  102069:	90                   	nop
  10206a:	e9 ac 01 00 00       	jmp    10221b <trap_dispatch+0x3ad>
		break;
  10206f:	90                   	nop
        break;
  102070:	e9 a6 01 00 00       	jmp    10221b <trap_dispatch+0x3ad>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
  102075:	e8 b5 f6 ff ff       	call   10172f <cons_getc>
  10207a:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("kbd [%03d] %c\n", c, c);
  10207d:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
  102081:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  102085:	89 54 24 08          	mov    %edx,0x8(%esp)
  102089:	89 44 24 04          	mov    %eax,0x4(%esp)
  10208d:	c7 04 24 7f 9a 10 00 	movl   $0x109a7f,(%esp)
  102094:	e8 1c e2 ff ff       	call   1002b5 <cprintf>
			tf->tf_ss = tf->tf_ds = tf->tf_es = tf->tf_gs = tf->tf_fs = USER_DS;
			tf->tf_esp += 4;
			tf->tf_eflags |= FL_IOPL_MASK;
		}
		break;*/
		asm volatile("movl %%esp, %0" : "=r" (esp0));
  102099:	89 e0                	mov    %esp,%eax
  10209b:	a3 a4 6f 12 00       	mov    %eax,0x126fa4
		newtf=(struct trapframe *)(esp0-0x100);
  1020a0:	a1 a4 6f 12 00       	mov    0x126fa4,%eax
  1020a5:	2d 00 01 00 00       	sub    $0x100,%eax
  1020aa:	a3 a8 6f 12 00       	mov    %eax,0x126fa8
		if (trap_in_kernel(tf)) {
  1020af:	8b 45 08             	mov    0x8(%ebp),%eax
  1020b2:	89 04 24             	mov    %eax,(%esp)
  1020b5:	e8 2a fb ff ff       	call   101be4 <trap_in_kernel>
  1020ba:	85 c0                	test   %eax,%eax
  1020bc:	0f 84 55 01 00 00    	je     102217 <trap_dispatch+0x3a9>
			memmove(newtf, tf, sizeof(struct trapframe) - 8);
  1020c2:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  1020c7:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  1020ce:	00 
  1020cf:	8b 55 08             	mov    0x8(%ebp),%edx
  1020d2:	89 54 24 04          	mov    %edx,0x4(%esp)
  1020d6:	89 04 24             	mov    %eax,(%esp)
  1020d9:	e8 43 6c 00 00       	call   108d21 <memmove>
			newtf->tf_cs = USER_CS;
  1020de:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  1020e3:	66 c7 40 3c 1b 00    	movw   $0x1b,0x3c(%eax)
			newtf->tf_ss = newtf->tf_ds = newtf->tf_es = newtf->tf_gs = newtf->tf_fs = USER_DS;
  1020e9:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  1020ef:	66 c7 42 24 23 00    	movw   $0x23,0x24(%edx)
  1020f5:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  1020fa:	0f b7 52 24          	movzwl 0x24(%edx),%edx
  1020fe:	66 89 50 20          	mov    %dx,0x20(%eax)
  102102:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  102108:	0f b7 40 20          	movzwl 0x20(%eax),%eax
  10210c:	66 89 42 28          	mov    %ax,0x28(%edx)
  102110:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  102115:	0f b7 52 28          	movzwl 0x28(%edx),%edx
  102119:	66 89 50 2c          	mov    %dx,0x2c(%eax)
  10211d:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  102123:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
  102127:	66 89 42 48          	mov    %ax,0x48(%edx)
			newtf->tf_esp = (uint32_t)tf + sizeof(struct trapframe);
  10212b:	8b 55 08             	mov    0x8(%ebp),%edx
  10212e:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  102133:	83 c2 4c             	add    $0x4c,%edx
  102136:	89 50 44             	mov    %edx,0x44(%eax)
			newtf->tf_eflags |= FL_IOPL_MASK;
  102139:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  10213e:	8b 50 40             	mov    0x40(%eax),%edx
  102141:	a1 a8 6f 12 00       	mov    0x126fa8,%eax
  102146:	81 ca 00 30 00 00    	or     $0x3000,%edx
  10214c:	89 50 40             	mov    %edx,0x40(%eax)
			*((uint32_t *)tf - 1) = (uint32_t)newtf;
  10214f:	8b 15 a8 6f 12 00    	mov    0x126fa8,%edx
  102155:	8b 45 08             	mov    0x8(%ebp),%eax
  102158:	83 e8 04             	sub    $0x4,%eax
  10215b:	89 10                	mov    %edx,(%eax)
		}
		break;
  10215d:	e9 b5 00 00 00       	jmp    102217 <trap_dispatch+0x3a9>
    case T_SWITCH_TOK:
    if (tf->tf_cs != KERNEL_CS) {
  102162:	8b 45 08             	mov    0x8(%ebp),%eax
  102165:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  102169:	83 f8 08             	cmp    $0x8,%eax
  10216c:	0f 84 a8 00 00 00    	je     10221a <trap_dispatch+0x3ac>
            tf->tf_cs = KERNEL_CS;
  102172:	8b 45 08             	mov    0x8(%ebp),%eax
  102175:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            tf->tf_ds = tf->tf_es = KERNEL_DS;
  10217b:	8b 45 08             	mov    0x8(%ebp),%eax
  10217e:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
  102184:	8b 45 08             	mov    0x8(%ebp),%eax
  102187:	0f b7 50 28          	movzwl 0x28(%eax),%edx
  10218b:	8b 45 08             	mov    0x8(%ebp),%eax
  10218e:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            tf->tf_eflags &= ~FL_IOPL_MASK;
  102192:	8b 45 08             	mov    0x8(%ebp),%eax
  102195:	8b 40 40             	mov    0x40(%eax),%eax
  102198:	25 ff cf ff ff       	and    $0xffffcfff,%eax
  10219d:	89 c2                	mov    %eax,%edx
  10219f:	8b 45 08             	mov    0x8(%ebp),%eax
  1021a2:	89 50 40             	mov    %edx,0x40(%eax)
            switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
  1021a5:	8b 45 08             	mov    0x8(%ebp),%eax
  1021a8:	8b 40 44             	mov    0x44(%eax),%eax
  1021ab:	83 e8 44             	sub    $0x44,%eax
  1021ae:	a3 ac 6f 12 00       	mov    %eax,0x126fac
            memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
  1021b3:	a1 ac 6f 12 00       	mov    0x126fac,%eax
  1021b8:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  1021bf:	00 
  1021c0:	8b 55 08             	mov    0x8(%ebp),%edx
  1021c3:	89 54 24 04          	mov    %edx,0x4(%esp)
  1021c7:	89 04 24             	mov    %eax,(%esp)
  1021ca:	e8 52 6b 00 00       	call   108d21 <memmove>
            *((uint32_t *)tf - 1) = (uint32_t)switchu2k;
  1021cf:	8b 15 ac 6f 12 00    	mov    0x126fac,%edx
  1021d5:	8b 45 08             	mov    0x8(%ebp),%eax
  1021d8:	83 e8 04             	sub    $0x4,%eax
  1021db:	89 10                	mov    %edx,(%eax)
        }
        break;
  1021dd:	eb 3b                	jmp    10221a <trap_dispatch+0x3ac>
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
  1021df:	8b 45 08             	mov    0x8(%ebp),%eax
  1021e2:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  1021e6:	83 e0 03             	and    $0x3,%eax
  1021e9:	85 c0                	test   %eax,%eax
  1021eb:	75 2e                	jne    10221b <trap_dispatch+0x3ad>
            print_trapframe(tf);
  1021ed:	8b 45 08             	mov    0x8(%ebp),%eax
  1021f0:	89 04 24             	mov    %eax,(%esp)
  1021f3:	e8 05 fa ff ff       	call   101bfd <print_trapframe>
            panic("unexpected trap in kernel.\n");
  1021f8:	c7 44 24 08 8e 9a 10 	movl   $0x109a8e,0x8(%esp)
  1021ff:	00 
  102200:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
  102207:	00 
  102208:	c7 04 24 aa 9a 10 00 	movl   $0x109aaa,(%esp)
  10220f:	e8 0d e2 ff ff       	call   100421 <__panic>
        break;
  102214:	90                   	nop
  102215:	eb 04                	jmp    10221b <trap_dispatch+0x3ad>
		break;
  102217:	90                   	nop
  102218:	eb 01                	jmp    10221b <trap_dispatch+0x3ad>
        break;
  10221a:	90                   	nop
        }
    }
}
  10221b:	90                   	nop
  10221c:	c9                   	leave  
  10221d:	c3                   	ret    

0010221e <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
  10221e:	f3 0f 1e fb          	endbr32 
  102222:	55                   	push   %ebp
  102223:	89 e5                	mov    %esp,%ebp
  102225:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
  102228:	8b 45 08             	mov    0x8(%ebp),%eax
  10222b:	89 04 24             	mov    %eax,(%esp)
  10222e:	e8 3b fc ff ff       	call   101e6e <trap_dispatch>
}
  102233:	90                   	nop
  102234:	c9                   	leave  
  102235:	c3                   	ret    

00102236 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
  102236:	6a 00                	push   $0x0
  pushl $0
  102238:	6a 00                	push   $0x0
  jmp __alltraps
  10223a:	e9 69 0a 00 00       	jmp    102ca8 <__alltraps>

0010223f <vector1>:
.globl vector1
vector1:
  pushl $0
  10223f:	6a 00                	push   $0x0
  pushl $1
  102241:	6a 01                	push   $0x1
  jmp __alltraps
  102243:	e9 60 0a 00 00       	jmp    102ca8 <__alltraps>

00102248 <vector2>:
.globl vector2
vector2:
  pushl $0
  102248:	6a 00                	push   $0x0
  pushl $2
  10224a:	6a 02                	push   $0x2
  jmp __alltraps
  10224c:	e9 57 0a 00 00       	jmp    102ca8 <__alltraps>

00102251 <vector3>:
.globl vector3
vector3:
  pushl $0
  102251:	6a 00                	push   $0x0
  pushl $3
  102253:	6a 03                	push   $0x3
  jmp __alltraps
  102255:	e9 4e 0a 00 00       	jmp    102ca8 <__alltraps>

0010225a <vector4>:
.globl vector4
vector4:
  pushl $0
  10225a:	6a 00                	push   $0x0
  pushl $4
  10225c:	6a 04                	push   $0x4
  jmp __alltraps
  10225e:	e9 45 0a 00 00       	jmp    102ca8 <__alltraps>

00102263 <vector5>:
.globl vector5
vector5:
  pushl $0
  102263:	6a 00                	push   $0x0
  pushl $5
  102265:	6a 05                	push   $0x5
  jmp __alltraps
  102267:	e9 3c 0a 00 00       	jmp    102ca8 <__alltraps>

0010226c <vector6>:
.globl vector6
vector6:
  pushl $0
  10226c:	6a 00                	push   $0x0
  pushl $6
  10226e:	6a 06                	push   $0x6
  jmp __alltraps
  102270:	e9 33 0a 00 00       	jmp    102ca8 <__alltraps>

00102275 <vector7>:
.globl vector7
vector7:
  pushl $0
  102275:	6a 00                	push   $0x0
  pushl $7
  102277:	6a 07                	push   $0x7
  jmp __alltraps
  102279:	e9 2a 0a 00 00       	jmp    102ca8 <__alltraps>

0010227e <vector8>:
.globl vector8
vector8:
  pushl $8
  10227e:	6a 08                	push   $0x8
  jmp __alltraps
  102280:	e9 23 0a 00 00       	jmp    102ca8 <__alltraps>

00102285 <vector9>:
.globl vector9
vector9:
  pushl $0
  102285:	6a 00                	push   $0x0
  pushl $9
  102287:	6a 09                	push   $0x9
  jmp __alltraps
  102289:	e9 1a 0a 00 00       	jmp    102ca8 <__alltraps>

0010228e <vector10>:
.globl vector10
vector10:
  pushl $10
  10228e:	6a 0a                	push   $0xa
  jmp __alltraps
  102290:	e9 13 0a 00 00       	jmp    102ca8 <__alltraps>

00102295 <vector11>:
.globl vector11
vector11:
  pushl $11
  102295:	6a 0b                	push   $0xb
  jmp __alltraps
  102297:	e9 0c 0a 00 00       	jmp    102ca8 <__alltraps>

0010229c <vector12>:
.globl vector12
vector12:
  pushl $12
  10229c:	6a 0c                	push   $0xc
  jmp __alltraps
  10229e:	e9 05 0a 00 00       	jmp    102ca8 <__alltraps>

001022a3 <vector13>:
.globl vector13
vector13:
  pushl $13
  1022a3:	6a 0d                	push   $0xd
  jmp __alltraps
  1022a5:	e9 fe 09 00 00       	jmp    102ca8 <__alltraps>

001022aa <vector14>:
.globl vector14
vector14:
  pushl $14
  1022aa:	6a 0e                	push   $0xe
  jmp __alltraps
  1022ac:	e9 f7 09 00 00       	jmp    102ca8 <__alltraps>

001022b1 <vector15>:
.globl vector15
vector15:
  pushl $0
  1022b1:	6a 00                	push   $0x0
  pushl $15
  1022b3:	6a 0f                	push   $0xf
  jmp __alltraps
  1022b5:	e9 ee 09 00 00       	jmp    102ca8 <__alltraps>

001022ba <vector16>:
.globl vector16
vector16:
  pushl $0
  1022ba:	6a 00                	push   $0x0
  pushl $16
  1022bc:	6a 10                	push   $0x10
  jmp __alltraps
  1022be:	e9 e5 09 00 00       	jmp    102ca8 <__alltraps>

001022c3 <vector17>:
.globl vector17
vector17:
  pushl $17
  1022c3:	6a 11                	push   $0x11
  jmp __alltraps
  1022c5:	e9 de 09 00 00       	jmp    102ca8 <__alltraps>

001022ca <vector18>:
.globl vector18
vector18:
  pushl $0
  1022ca:	6a 00                	push   $0x0
  pushl $18
  1022cc:	6a 12                	push   $0x12
  jmp __alltraps
  1022ce:	e9 d5 09 00 00       	jmp    102ca8 <__alltraps>

001022d3 <vector19>:
.globl vector19
vector19:
  pushl $0
  1022d3:	6a 00                	push   $0x0
  pushl $19
  1022d5:	6a 13                	push   $0x13
  jmp __alltraps
  1022d7:	e9 cc 09 00 00       	jmp    102ca8 <__alltraps>

001022dc <vector20>:
.globl vector20
vector20:
  pushl $0
  1022dc:	6a 00                	push   $0x0
  pushl $20
  1022de:	6a 14                	push   $0x14
  jmp __alltraps
  1022e0:	e9 c3 09 00 00       	jmp    102ca8 <__alltraps>

001022e5 <vector21>:
.globl vector21
vector21:
  pushl $0
  1022e5:	6a 00                	push   $0x0
  pushl $21
  1022e7:	6a 15                	push   $0x15
  jmp __alltraps
  1022e9:	e9 ba 09 00 00       	jmp    102ca8 <__alltraps>

001022ee <vector22>:
.globl vector22
vector22:
  pushl $0
  1022ee:	6a 00                	push   $0x0
  pushl $22
  1022f0:	6a 16                	push   $0x16
  jmp __alltraps
  1022f2:	e9 b1 09 00 00       	jmp    102ca8 <__alltraps>

001022f7 <vector23>:
.globl vector23
vector23:
  pushl $0
  1022f7:	6a 00                	push   $0x0
  pushl $23
  1022f9:	6a 17                	push   $0x17
  jmp __alltraps
  1022fb:	e9 a8 09 00 00       	jmp    102ca8 <__alltraps>

00102300 <vector24>:
.globl vector24
vector24:
  pushl $0
  102300:	6a 00                	push   $0x0
  pushl $24
  102302:	6a 18                	push   $0x18
  jmp __alltraps
  102304:	e9 9f 09 00 00       	jmp    102ca8 <__alltraps>

00102309 <vector25>:
.globl vector25
vector25:
  pushl $0
  102309:	6a 00                	push   $0x0
  pushl $25
  10230b:	6a 19                	push   $0x19
  jmp __alltraps
  10230d:	e9 96 09 00 00       	jmp    102ca8 <__alltraps>

00102312 <vector26>:
.globl vector26
vector26:
  pushl $0
  102312:	6a 00                	push   $0x0
  pushl $26
  102314:	6a 1a                	push   $0x1a
  jmp __alltraps
  102316:	e9 8d 09 00 00       	jmp    102ca8 <__alltraps>

0010231b <vector27>:
.globl vector27
vector27:
  pushl $0
  10231b:	6a 00                	push   $0x0
  pushl $27
  10231d:	6a 1b                	push   $0x1b
  jmp __alltraps
  10231f:	e9 84 09 00 00       	jmp    102ca8 <__alltraps>

00102324 <vector28>:
.globl vector28
vector28:
  pushl $0
  102324:	6a 00                	push   $0x0
  pushl $28
  102326:	6a 1c                	push   $0x1c
  jmp __alltraps
  102328:	e9 7b 09 00 00       	jmp    102ca8 <__alltraps>

0010232d <vector29>:
.globl vector29
vector29:
  pushl $0
  10232d:	6a 00                	push   $0x0
  pushl $29
  10232f:	6a 1d                	push   $0x1d
  jmp __alltraps
  102331:	e9 72 09 00 00       	jmp    102ca8 <__alltraps>

00102336 <vector30>:
.globl vector30
vector30:
  pushl $0
  102336:	6a 00                	push   $0x0
  pushl $30
  102338:	6a 1e                	push   $0x1e
  jmp __alltraps
  10233a:	e9 69 09 00 00       	jmp    102ca8 <__alltraps>

0010233f <vector31>:
.globl vector31
vector31:
  pushl $0
  10233f:	6a 00                	push   $0x0
  pushl $31
  102341:	6a 1f                	push   $0x1f
  jmp __alltraps
  102343:	e9 60 09 00 00       	jmp    102ca8 <__alltraps>

00102348 <vector32>:
.globl vector32
vector32:
  pushl $0
  102348:	6a 00                	push   $0x0
  pushl $32
  10234a:	6a 20                	push   $0x20
  jmp __alltraps
  10234c:	e9 57 09 00 00       	jmp    102ca8 <__alltraps>

00102351 <vector33>:
.globl vector33
vector33:
  pushl $0
  102351:	6a 00                	push   $0x0
  pushl $33
  102353:	6a 21                	push   $0x21
  jmp __alltraps
  102355:	e9 4e 09 00 00       	jmp    102ca8 <__alltraps>

0010235a <vector34>:
.globl vector34
vector34:
  pushl $0
  10235a:	6a 00                	push   $0x0
  pushl $34
  10235c:	6a 22                	push   $0x22
  jmp __alltraps
  10235e:	e9 45 09 00 00       	jmp    102ca8 <__alltraps>

00102363 <vector35>:
.globl vector35
vector35:
  pushl $0
  102363:	6a 00                	push   $0x0
  pushl $35
  102365:	6a 23                	push   $0x23
  jmp __alltraps
  102367:	e9 3c 09 00 00       	jmp    102ca8 <__alltraps>

0010236c <vector36>:
.globl vector36
vector36:
  pushl $0
  10236c:	6a 00                	push   $0x0
  pushl $36
  10236e:	6a 24                	push   $0x24
  jmp __alltraps
  102370:	e9 33 09 00 00       	jmp    102ca8 <__alltraps>

00102375 <vector37>:
.globl vector37
vector37:
  pushl $0
  102375:	6a 00                	push   $0x0
  pushl $37
  102377:	6a 25                	push   $0x25
  jmp __alltraps
  102379:	e9 2a 09 00 00       	jmp    102ca8 <__alltraps>

0010237e <vector38>:
.globl vector38
vector38:
  pushl $0
  10237e:	6a 00                	push   $0x0
  pushl $38
  102380:	6a 26                	push   $0x26
  jmp __alltraps
  102382:	e9 21 09 00 00       	jmp    102ca8 <__alltraps>

00102387 <vector39>:
.globl vector39
vector39:
  pushl $0
  102387:	6a 00                	push   $0x0
  pushl $39
  102389:	6a 27                	push   $0x27
  jmp __alltraps
  10238b:	e9 18 09 00 00       	jmp    102ca8 <__alltraps>

00102390 <vector40>:
.globl vector40
vector40:
  pushl $0
  102390:	6a 00                	push   $0x0
  pushl $40
  102392:	6a 28                	push   $0x28
  jmp __alltraps
  102394:	e9 0f 09 00 00       	jmp    102ca8 <__alltraps>

00102399 <vector41>:
.globl vector41
vector41:
  pushl $0
  102399:	6a 00                	push   $0x0
  pushl $41
  10239b:	6a 29                	push   $0x29
  jmp __alltraps
  10239d:	e9 06 09 00 00       	jmp    102ca8 <__alltraps>

001023a2 <vector42>:
.globl vector42
vector42:
  pushl $0
  1023a2:	6a 00                	push   $0x0
  pushl $42
  1023a4:	6a 2a                	push   $0x2a
  jmp __alltraps
  1023a6:	e9 fd 08 00 00       	jmp    102ca8 <__alltraps>

001023ab <vector43>:
.globl vector43
vector43:
  pushl $0
  1023ab:	6a 00                	push   $0x0
  pushl $43
  1023ad:	6a 2b                	push   $0x2b
  jmp __alltraps
  1023af:	e9 f4 08 00 00       	jmp    102ca8 <__alltraps>

001023b4 <vector44>:
.globl vector44
vector44:
  pushl $0
  1023b4:	6a 00                	push   $0x0
  pushl $44
  1023b6:	6a 2c                	push   $0x2c
  jmp __alltraps
  1023b8:	e9 eb 08 00 00       	jmp    102ca8 <__alltraps>

001023bd <vector45>:
.globl vector45
vector45:
  pushl $0
  1023bd:	6a 00                	push   $0x0
  pushl $45
  1023bf:	6a 2d                	push   $0x2d
  jmp __alltraps
  1023c1:	e9 e2 08 00 00       	jmp    102ca8 <__alltraps>

001023c6 <vector46>:
.globl vector46
vector46:
  pushl $0
  1023c6:	6a 00                	push   $0x0
  pushl $46
  1023c8:	6a 2e                	push   $0x2e
  jmp __alltraps
  1023ca:	e9 d9 08 00 00       	jmp    102ca8 <__alltraps>

001023cf <vector47>:
.globl vector47
vector47:
  pushl $0
  1023cf:	6a 00                	push   $0x0
  pushl $47
  1023d1:	6a 2f                	push   $0x2f
  jmp __alltraps
  1023d3:	e9 d0 08 00 00       	jmp    102ca8 <__alltraps>

001023d8 <vector48>:
.globl vector48
vector48:
  pushl $0
  1023d8:	6a 00                	push   $0x0
  pushl $48
  1023da:	6a 30                	push   $0x30
  jmp __alltraps
  1023dc:	e9 c7 08 00 00       	jmp    102ca8 <__alltraps>

001023e1 <vector49>:
.globl vector49
vector49:
  pushl $0
  1023e1:	6a 00                	push   $0x0
  pushl $49
  1023e3:	6a 31                	push   $0x31
  jmp __alltraps
  1023e5:	e9 be 08 00 00       	jmp    102ca8 <__alltraps>

001023ea <vector50>:
.globl vector50
vector50:
  pushl $0
  1023ea:	6a 00                	push   $0x0
  pushl $50
  1023ec:	6a 32                	push   $0x32
  jmp __alltraps
  1023ee:	e9 b5 08 00 00       	jmp    102ca8 <__alltraps>

001023f3 <vector51>:
.globl vector51
vector51:
  pushl $0
  1023f3:	6a 00                	push   $0x0
  pushl $51
  1023f5:	6a 33                	push   $0x33
  jmp __alltraps
  1023f7:	e9 ac 08 00 00       	jmp    102ca8 <__alltraps>

001023fc <vector52>:
.globl vector52
vector52:
  pushl $0
  1023fc:	6a 00                	push   $0x0
  pushl $52
  1023fe:	6a 34                	push   $0x34
  jmp __alltraps
  102400:	e9 a3 08 00 00       	jmp    102ca8 <__alltraps>

00102405 <vector53>:
.globl vector53
vector53:
  pushl $0
  102405:	6a 00                	push   $0x0
  pushl $53
  102407:	6a 35                	push   $0x35
  jmp __alltraps
  102409:	e9 9a 08 00 00       	jmp    102ca8 <__alltraps>

0010240e <vector54>:
.globl vector54
vector54:
  pushl $0
  10240e:	6a 00                	push   $0x0
  pushl $54
  102410:	6a 36                	push   $0x36
  jmp __alltraps
  102412:	e9 91 08 00 00       	jmp    102ca8 <__alltraps>

00102417 <vector55>:
.globl vector55
vector55:
  pushl $0
  102417:	6a 00                	push   $0x0
  pushl $55
  102419:	6a 37                	push   $0x37
  jmp __alltraps
  10241b:	e9 88 08 00 00       	jmp    102ca8 <__alltraps>

00102420 <vector56>:
.globl vector56
vector56:
  pushl $0
  102420:	6a 00                	push   $0x0
  pushl $56
  102422:	6a 38                	push   $0x38
  jmp __alltraps
  102424:	e9 7f 08 00 00       	jmp    102ca8 <__alltraps>

00102429 <vector57>:
.globl vector57
vector57:
  pushl $0
  102429:	6a 00                	push   $0x0
  pushl $57
  10242b:	6a 39                	push   $0x39
  jmp __alltraps
  10242d:	e9 76 08 00 00       	jmp    102ca8 <__alltraps>

00102432 <vector58>:
.globl vector58
vector58:
  pushl $0
  102432:	6a 00                	push   $0x0
  pushl $58
  102434:	6a 3a                	push   $0x3a
  jmp __alltraps
  102436:	e9 6d 08 00 00       	jmp    102ca8 <__alltraps>

0010243b <vector59>:
.globl vector59
vector59:
  pushl $0
  10243b:	6a 00                	push   $0x0
  pushl $59
  10243d:	6a 3b                	push   $0x3b
  jmp __alltraps
  10243f:	e9 64 08 00 00       	jmp    102ca8 <__alltraps>

00102444 <vector60>:
.globl vector60
vector60:
  pushl $0
  102444:	6a 00                	push   $0x0
  pushl $60
  102446:	6a 3c                	push   $0x3c
  jmp __alltraps
  102448:	e9 5b 08 00 00       	jmp    102ca8 <__alltraps>

0010244d <vector61>:
.globl vector61
vector61:
  pushl $0
  10244d:	6a 00                	push   $0x0
  pushl $61
  10244f:	6a 3d                	push   $0x3d
  jmp __alltraps
  102451:	e9 52 08 00 00       	jmp    102ca8 <__alltraps>

00102456 <vector62>:
.globl vector62
vector62:
  pushl $0
  102456:	6a 00                	push   $0x0
  pushl $62
  102458:	6a 3e                	push   $0x3e
  jmp __alltraps
  10245a:	e9 49 08 00 00       	jmp    102ca8 <__alltraps>

0010245f <vector63>:
.globl vector63
vector63:
  pushl $0
  10245f:	6a 00                	push   $0x0
  pushl $63
  102461:	6a 3f                	push   $0x3f
  jmp __alltraps
  102463:	e9 40 08 00 00       	jmp    102ca8 <__alltraps>

00102468 <vector64>:
.globl vector64
vector64:
  pushl $0
  102468:	6a 00                	push   $0x0
  pushl $64
  10246a:	6a 40                	push   $0x40
  jmp __alltraps
  10246c:	e9 37 08 00 00       	jmp    102ca8 <__alltraps>

00102471 <vector65>:
.globl vector65
vector65:
  pushl $0
  102471:	6a 00                	push   $0x0
  pushl $65
  102473:	6a 41                	push   $0x41
  jmp __alltraps
  102475:	e9 2e 08 00 00       	jmp    102ca8 <__alltraps>

0010247a <vector66>:
.globl vector66
vector66:
  pushl $0
  10247a:	6a 00                	push   $0x0
  pushl $66
  10247c:	6a 42                	push   $0x42
  jmp __alltraps
  10247e:	e9 25 08 00 00       	jmp    102ca8 <__alltraps>

00102483 <vector67>:
.globl vector67
vector67:
  pushl $0
  102483:	6a 00                	push   $0x0
  pushl $67
  102485:	6a 43                	push   $0x43
  jmp __alltraps
  102487:	e9 1c 08 00 00       	jmp    102ca8 <__alltraps>

0010248c <vector68>:
.globl vector68
vector68:
  pushl $0
  10248c:	6a 00                	push   $0x0
  pushl $68
  10248e:	6a 44                	push   $0x44
  jmp __alltraps
  102490:	e9 13 08 00 00       	jmp    102ca8 <__alltraps>

00102495 <vector69>:
.globl vector69
vector69:
  pushl $0
  102495:	6a 00                	push   $0x0
  pushl $69
  102497:	6a 45                	push   $0x45
  jmp __alltraps
  102499:	e9 0a 08 00 00       	jmp    102ca8 <__alltraps>

0010249e <vector70>:
.globl vector70
vector70:
  pushl $0
  10249e:	6a 00                	push   $0x0
  pushl $70
  1024a0:	6a 46                	push   $0x46
  jmp __alltraps
  1024a2:	e9 01 08 00 00       	jmp    102ca8 <__alltraps>

001024a7 <vector71>:
.globl vector71
vector71:
  pushl $0
  1024a7:	6a 00                	push   $0x0
  pushl $71
  1024a9:	6a 47                	push   $0x47
  jmp __alltraps
  1024ab:	e9 f8 07 00 00       	jmp    102ca8 <__alltraps>

001024b0 <vector72>:
.globl vector72
vector72:
  pushl $0
  1024b0:	6a 00                	push   $0x0
  pushl $72
  1024b2:	6a 48                	push   $0x48
  jmp __alltraps
  1024b4:	e9 ef 07 00 00       	jmp    102ca8 <__alltraps>

001024b9 <vector73>:
.globl vector73
vector73:
  pushl $0
  1024b9:	6a 00                	push   $0x0
  pushl $73
  1024bb:	6a 49                	push   $0x49
  jmp __alltraps
  1024bd:	e9 e6 07 00 00       	jmp    102ca8 <__alltraps>

001024c2 <vector74>:
.globl vector74
vector74:
  pushl $0
  1024c2:	6a 00                	push   $0x0
  pushl $74
  1024c4:	6a 4a                	push   $0x4a
  jmp __alltraps
  1024c6:	e9 dd 07 00 00       	jmp    102ca8 <__alltraps>

001024cb <vector75>:
.globl vector75
vector75:
  pushl $0
  1024cb:	6a 00                	push   $0x0
  pushl $75
  1024cd:	6a 4b                	push   $0x4b
  jmp __alltraps
  1024cf:	e9 d4 07 00 00       	jmp    102ca8 <__alltraps>

001024d4 <vector76>:
.globl vector76
vector76:
  pushl $0
  1024d4:	6a 00                	push   $0x0
  pushl $76
  1024d6:	6a 4c                	push   $0x4c
  jmp __alltraps
  1024d8:	e9 cb 07 00 00       	jmp    102ca8 <__alltraps>

001024dd <vector77>:
.globl vector77
vector77:
  pushl $0
  1024dd:	6a 00                	push   $0x0
  pushl $77
  1024df:	6a 4d                	push   $0x4d
  jmp __alltraps
  1024e1:	e9 c2 07 00 00       	jmp    102ca8 <__alltraps>

001024e6 <vector78>:
.globl vector78
vector78:
  pushl $0
  1024e6:	6a 00                	push   $0x0
  pushl $78
  1024e8:	6a 4e                	push   $0x4e
  jmp __alltraps
  1024ea:	e9 b9 07 00 00       	jmp    102ca8 <__alltraps>

001024ef <vector79>:
.globl vector79
vector79:
  pushl $0
  1024ef:	6a 00                	push   $0x0
  pushl $79
  1024f1:	6a 4f                	push   $0x4f
  jmp __alltraps
  1024f3:	e9 b0 07 00 00       	jmp    102ca8 <__alltraps>

001024f8 <vector80>:
.globl vector80
vector80:
  pushl $0
  1024f8:	6a 00                	push   $0x0
  pushl $80
  1024fa:	6a 50                	push   $0x50
  jmp __alltraps
  1024fc:	e9 a7 07 00 00       	jmp    102ca8 <__alltraps>

00102501 <vector81>:
.globl vector81
vector81:
  pushl $0
  102501:	6a 00                	push   $0x0
  pushl $81
  102503:	6a 51                	push   $0x51
  jmp __alltraps
  102505:	e9 9e 07 00 00       	jmp    102ca8 <__alltraps>

0010250a <vector82>:
.globl vector82
vector82:
  pushl $0
  10250a:	6a 00                	push   $0x0
  pushl $82
  10250c:	6a 52                	push   $0x52
  jmp __alltraps
  10250e:	e9 95 07 00 00       	jmp    102ca8 <__alltraps>

00102513 <vector83>:
.globl vector83
vector83:
  pushl $0
  102513:	6a 00                	push   $0x0
  pushl $83
  102515:	6a 53                	push   $0x53
  jmp __alltraps
  102517:	e9 8c 07 00 00       	jmp    102ca8 <__alltraps>

0010251c <vector84>:
.globl vector84
vector84:
  pushl $0
  10251c:	6a 00                	push   $0x0
  pushl $84
  10251e:	6a 54                	push   $0x54
  jmp __alltraps
  102520:	e9 83 07 00 00       	jmp    102ca8 <__alltraps>

00102525 <vector85>:
.globl vector85
vector85:
  pushl $0
  102525:	6a 00                	push   $0x0
  pushl $85
  102527:	6a 55                	push   $0x55
  jmp __alltraps
  102529:	e9 7a 07 00 00       	jmp    102ca8 <__alltraps>

0010252e <vector86>:
.globl vector86
vector86:
  pushl $0
  10252e:	6a 00                	push   $0x0
  pushl $86
  102530:	6a 56                	push   $0x56
  jmp __alltraps
  102532:	e9 71 07 00 00       	jmp    102ca8 <__alltraps>

00102537 <vector87>:
.globl vector87
vector87:
  pushl $0
  102537:	6a 00                	push   $0x0
  pushl $87
  102539:	6a 57                	push   $0x57
  jmp __alltraps
  10253b:	e9 68 07 00 00       	jmp    102ca8 <__alltraps>

00102540 <vector88>:
.globl vector88
vector88:
  pushl $0
  102540:	6a 00                	push   $0x0
  pushl $88
  102542:	6a 58                	push   $0x58
  jmp __alltraps
  102544:	e9 5f 07 00 00       	jmp    102ca8 <__alltraps>

00102549 <vector89>:
.globl vector89
vector89:
  pushl $0
  102549:	6a 00                	push   $0x0
  pushl $89
  10254b:	6a 59                	push   $0x59
  jmp __alltraps
  10254d:	e9 56 07 00 00       	jmp    102ca8 <__alltraps>

00102552 <vector90>:
.globl vector90
vector90:
  pushl $0
  102552:	6a 00                	push   $0x0
  pushl $90
  102554:	6a 5a                	push   $0x5a
  jmp __alltraps
  102556:	e9 4d 07 00 00       	jmp    102ca8 <__alltraps>

0010255b <vector91>:
.globl vector91
vector91:
  pushl $0
  10255b:	6a 00                	push   $0x0
  pushl $91
  10255d:	6a 5b                	push   $0x5b
  jmp __alltraps
  10255f:	e9 44 07 00 00       	jmp    102ca8 <__alltraps>

00102564 <vector92>:
.globl vector92
vector92:
  pushl $0
  102564:	6a 00                	push   $0x0
  pushl $92
  102566:	6a 5c                	push   $0x5c
  jmp __alltraps
  102568:	e9 3b 07 00 00       	jmp    102ca8 <__alltraps>

0010256d <vector93>:
.globl vector93
vector93:
  pushl $0
  10256d:	6a 00                	push   $0x0
  pushl $93
  10256f:	6a 5d                	push   $0x5d
  jmp __alltraps
  102571:	e9 32 07 00 00       	jmp    102ca8 <__alltraps>

00102576 <vector94>:
.globl vector94
vector94:
  pushl $0
  102576:	6a 00                	push   $0x0
  pushl $94
  102578:	6a 5e                	push   $0x5e
  jmp __alltraps
  10257a:	e9 29 07 00 00       	jmp    102ca8 <__alltraps>

0010257f <vector95>:
.globl vector95
vector95:
  pushl $0
  10257f:	6a 00                	push   $0x0
  pushl $95
  102581:	6a 5f                	push   $0x5f
  jmp __alltraps
  102583:	e9 20 07 00 00       	jmp    102ca8 <__alltraps>

00102588 <vector96>:
.globl vector96
vector96:
  pushl $0
  102588:	6a 00                	push   $0x0
  pushl $96
  10258a:	6a 60                	push   $0x60
  jmp __alltraps
  10258c:	e9 17 07 00 00       	jmp    102ca8 <__alltraps>

00102591 <vector97>:
.globl vector97
vector97:
  pushl $0
  102591:	6a 00                	push   $0x0
  pushl $97
  102593:	6a 61                	push   $0x61
  jmp __alltraps
  102595:	e9 0e 07 00 00       	jmp    102ca8 <__alltraps>

0010259a <vector98>:
.globl vector98
vector98:
  pushl $0
  10259a:	6a 00                	push   $0x0
  pushl $98
  10259c:	6a 62                	push   $0x62
  jmp __alltraps
  10259e:	e9 05 07 00 00       	jmp    102ca8 <__alltraps>

001025a3 <vector99>:
.globl vector99
vector99:
  pushl $0
  1025a3:	6a 00                	push   $0x0
  pushl $99
  1025a5:	6a 63                	push   $0x63
  jmp __alltraps
  1025a7:	e9 fc 06 00 00       	jmp    102ca8 <__alltraps>

001025ac <vector100>:
.globl vector100
vector100:
  pushl $0
  1025ac:	6a 00                	push   $0x0
  pushl $100
  1025ae:	6a 64                	push   $0x64
  jmp __alltraps
  1025b0:	e9 f3 06 00 00       	jmp    102ca8 <__alltraps>

001025b5 <vector101>:
.globl vector101
vector101:
  pushl $0
  1025b5:	6a 00                	push   $0x0
  pushl $101
  1025b7:	6a 65                	push   $0x65
  jmp __alltraps
  1025b9:	e9 ea 06 00 00       	jmp    102ca8 <__alltraps>

001025be <vector102>:
.globl vector102
vector102:
  pushl $0
  1025be:	6a 00                	push   $0x0
  pushl $102
  1025c0:	6a 66                	push   $0x66
  jmp __alltraps
  1025c2:	e9 e1 06 00 00       	jmp    102ca8 <__alltraps>

001025c7 <vector103>:
.globl vector103
vector103:
  pushl $0
  1025c7:	6a 00                	push   $0x0
  pushl $103
  1025c9:	6a 67                	push   $0x67
  jmp __alltraps
  1025cb:	e9 d8 06 00 00       	jmp    102ca8 <__alltraps>

001025d0 <vector104>:
.globl vector104
vector104:
  pushl $0
  1025d0:	6a 00                	push   $0x0
  pushl $104
  1025d2:	6a 68                	push   $0x68
  jmp __alltraps
  1025d4:	e9 cf 06 00 00       	jmp    102ca8 <__alltraps>

001025d9 <vector105>:
.globl vector105
vector105:
  pushl $0
  1025d9:	6a 00                	push   $0x0
  pushl $105
  1025db:	6a 69                	push   $0x69
  jmp __alltraps
  1025dd:	e9 c6 06 00 00       	jmp    102ca8 <__alltraps>

001025e2 <vector106>:
.globl vector106
vector106:
  pushl $0
  1025e2:	6a 00                	push   $0x0
  pushl $106
  1025e4:	6a 6a                	push   $0x6a
  jmp __alltraps
  1025e6:	e9 bd 06 00 00       	jmp    102ca8 <__alltraps>

001025eb <vector107>:
.globl vector107
vector107:
  pushl $0
  1025eb:	6a 00                	push   $0x0
  pushl $107
  1025ed:	6a 6b                	push   $0x6b
  jmp __alltraps
  1025ef:	e9 b4 06 00 00       	jmp    102ca8 <__alltraps>

001025f4 <vector108>:
.globl vector108
vector108:
  pushl $0
  1025f4:	6a 00                	push   $0x0
  pushl $108
  1025f6:	6a 6c                	push   $0x6c
  jmp __alltraps
  1025f8:	e9 ab 06 00 00       	jmp    102ca8 <__alltraps>

001025fd <vector109>:
.globl vector109
vector109:
  pushl $0
  1025fd:	6a 00                	push   $0x0
  pushl $109
  1025ff:	6a 6d                	push   $0x6d
  jmp __alltraps
  102601:	e9 a2 06 00 00       	jmp    102ca8 <__alltraps>

00102606 <vector110>:
.globl vector110
vector110:
  pushl $0
  102606:	6a 00                	push   $0x0
  pushl $110
  102608:	6a 6e                	push   $0x6e
  jmp __alltraps
  10260a:	e9 99 06 00 00       	jmp    102ca8 <__alltraps>

0010260f <vector111>:
.globl vector111
vector111:
  pushl $0
  10260f:	6a 00                	push   $0x0
  pushl $111
  102611:	6a 6f                	push   $0x6f
  jmp __alltraps
  102613:	e9 90 06 00 00       	jmp    102ca8 <__alltraps>

00102618 <vector112>:
.globl vector112
vector112:
  pushl $0
  102618:	6a 00                	push   $0x0
  pushl $112
  10261a:	6a 70                	push   $0x70
  jmp __alltraps
  10261c:	e9 87 06 00 00       	jmp    102ca8 <__alltraps>

00102621 <vector113>:
.globl vector113
vector113:
  pushl $0
  102621:	6a 00                	push   $0x0
  pushl $113
  102623:	6a 71                	push   $0x71
  jmp __alltraps
  102625:	e9 7e 06 00 00       	jmp    102ca8 <__alltraps>

0010262a <vector114>:
.globl vector114
vector114:
  pushl $0
  10262a:	6a 00                	push   $0x0
  pushl $114
  10262c:	6a 72                	push   $0x72
  jmp __alltraps
  10262e:	e9 75 06 00 00       	jmp    102ca8 <__alltraps>

00102633 <vector115>:
.globl vector115
vector115:
  pushl $0
  102633:	6a 00                	push   $0x0
  pushl $115
  102635:	6a 73                	push   $0x73
  jmp __alltraps
  102637:	e9 6c 06 00 00       	jmp    102ca8 <__alltraps>

0010263c <vector116>:
.globl vector116
vector116:
  pushl $0
  10263c:	6a 00                	push   $0x0
  pushl $116
  10263e:	6a 74                	push   $0x74
  jmp __alltraps
  102640:	e9 63 06 00 00       	jmp    102ca8 <__alltraps>

00102645 <vector117>:
.globl vector117
vector117:
  pushl $0
  102645:	6a 00                	push   $0x0
  pushl $117
  102647:	6a 75                	push   $0x75
  jmp __alltraps
  102649:	e9 5a 06 00 00       	jmp    102ca8 <__alltraps>

0010264e <vector118>:
.globl vector118
vector118:
  pushl $0
  10264e:	6a 00                	push   $0x0
  pushl $118
  102650:	6a 76                	push   $0x76
  jmp __alltraps
  102652:	e9 51 06 00 00       	jmp    102ca8 <__alltraps>

00102657 <vector119>:
.globl vector119
vector119:
  pushl $0
  102657:	6a 00                	push   $0x0
  pushl $119
  102659:	6a 77                	push   $0x77
  jmp __alltraps
  10265b:	e9 48 06 00 00       	jmp    102ca8 <__alltraps>

00102660 <vector120>:
.globl vector120
vector120:
  pushl $0
  102660:	6a 00                	push   $0x0
  pushl $120
  102662:	6a 78                	push   $0x78
  jmp __alltraps
  102664:	e9 3f 06 00 00       	jmp    102ca8 <__alltraps>

00102669 <vector121>:
.globl vector121
vector121:
  pushl $0
  102669:	6a 00                	push   $0x0
  pushl $121
  10266b:	6a 79                	push   $0x79
  jmp __alltraps
  10266d:	e9 36 06 00 00       	jmp    102ca8 <__alltraps>

00102672 <vector122>:
.globl vector122
vector122:
  pushl $0
  102672:	6a 00                	push   $0x0
  pushl $122
  102674:	6a 7a                	push   $0x7a
  jmp __alltraps
  102676:	e9 2d 06 00 00       	jmp    102ca8 <__alltraps>

0010267b <vector123>:
.globl vector123
vector123:
  pushl $0
  10267b:	6a 00                	push   $0x0
  pushl $123
  10267d:	6a 7b                	push   $0x7b
  jmp __alltraps
  10267f:	e9 24 06 00 00       	jmp    102ca8 <__alltraps>

00102684 <vector124>:
.globl vector124
vector124:
  pushl $0
  102684:	6a 00                	push   $0x0
  pushl $124
  102686:	6a 7c                	push   $0x7c
  jmp __alltraps
  102688:	e9 1b 06 00 00       	jmp    102ca8 <__alltraps>

0010268d <vector125>:
.globl vector125
vector125:
  pushl $0
  10268d:	6a 00                	push   $0x0
  pushl $125
  10268f:	6a 7d                	push   $0x7d
  jmp __alltraps
  102691:	e9 12 06 00 00       	jmp    102ca8 <__alltraps>

00102696 <vector126>:
.globl vector126
vector126:
  pushl $0
  102696:	6a 00                	push   $0x0
  pushl $126
  102698:	6a 7e                	push   $0x7e
  jmp __alltraps
  10269a:	e9 09 06 00 00       	jmp    102ca8 <__alltraps>

0010269f <vector127>:
.globl vector127
vector127:
  pushl $0
  10269f:	6a 00                	push   $0x0
  pushl $127
  1026a1:	6a 7f                	push   $0x7f
  jmp __alltraps
  1026a3:	e9 00 06 00 00       	jmp    102ca8 <__alltraps>

001026a8 <vector128>:
.globl vector128
vector128:
  pushl $0
  1026a8:	6a 00                	push   $0x0
  pushl $128
  1026aa:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
  1026af:	e9 f4 05 00 00       	jmp    102ca8 <__alltraps>

001026b4 <vector129>:
.globl vector129
vector129:
  pushl $0
  1026b4:	6a 00                	push   $0x0
  pushl $129
  1026b6:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
  1026bb:	e9 e8 05 00 00       	jmp    102ca8 <__alltraps>

001026c0 <vector130>:
.globl vector130
vector130:
  pushl $0
  1026c0:	6a 00                	push   $0x0
  pushl $130
  1026c2:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
  1026c7:	e9 dc 05 00 00       	jmp    102ca8 <__alltraps>

001026cc <vector131>:
.globl vector131
vector131:
  pushl $0
  1026cc:	6a 00                	push   $0x0
  pushl $131
  1026ce:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
  1026d3:	e9 d0 05 00 00       	jmp    102ca8 <__alltraps>

001026d8 <vector132>:
.globl vector132
vector132:
  pushl $0
  1026d8:	6a 00                	push   $0x0
  pushl $132
  1026da:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
  1026df:	e9 c4 05 00 00       	jmp    102ca8 <__alltraps>

001026e4 <vector133>:
.globl vector133
vector133:
  pushl $0
  1026e4:	6a 00                	push   $0x0
  pushl $133
  1026e6:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
  1026eb:	e9 b8 05 00 00       	jmp    102ca8 <__alltraps>

001026f0 <vector134>:
.globl vector134
vector134:
  pushl $0
  1026f0:	6a 00                	push   $0x0
  pushl $134
  1026f2:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
  1026f7:	e9 ac 05 00 00       	jmp    102ca8 <__alltraps>

001026fc <vector135>:
.globl vector135
vector135:
  pushl $0
  1026fc:	6a 00                	push   $0x0
  pushl $135
  1026fe:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
  102703:	e9 a0 05 00 00       	jmp    102ca8 <__alltraps>

00102708 <vector136>:
.globl vector136
vector136:
  pushl $0
  102708:	6a 00                	push   $0x0
  pushl $136
  10270a:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
  10270f:	e9 94 05 00 00       	jmp    102ca8 <__alltraps>

00102714 <vector137>:
.globl vector137
vector137:
  pushl $0
  102714:	6a 00                	push   $0x0
  pushl $137
  102716:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
  10271b:	e9 88 05 00 00       	jmp    102ca8 <__alltraps>

00102720 <vector138>:
.globl vector138
vector138:
  pushl $0
  102720:	6a 00                	push   $0x0
  pushl $138
  102722:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
  102727:	e9 7c 05 00 00       	jmp    102ca8 <__alltraps>

0010272c <vector139>:
.globl vector139
vector139:
  pushl $0
  10272c:	6a 00                	push   $0x0
  pushl $139
  10272e:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
  102733:	e9 70 05 00 00       	jmp    102ca8 <__alltraps>

00102738 <vector140>:
.globl vector140
vector140:
  pushl $0
  102738:	6a 00                	push   $0x0
  pushl $140
  10273a:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
  10273f:	e9 64 05 00 00       	jmp    102ca8 <__alltraps>

00102744 <vector141>:
.globl vector141
vector141:
  pushl $0
  102744:	6a 00                	push   $0x0
  pushl $141
  102746:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
  10274b:	e9 58 05 00 00       	jmp    102ca8 <__alltraps>

00102750 <vector142>:
.globl vector142
vector142:
  pushl $0
  102750:	6a 00                	push   $0x0
  pushl $142
  102752:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
  102757:	e9 4c 05 00 00       	jmp    102ca8 <__alltraps>

0010275c <vector143>:
.globl vector143
vector143:
  pushl $0
  10275c:	6a 00                	push   $0x0
  pushl $143
  10275e:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
  102763:	e9 40 05 00 00       	jmp    102ca8 <__alltraps>

00102768 <vector144>:
.globl vector144
vector144:
  pushl $0
  102768:	6a 00                	push   $0x0
  pushl $144
  10276a:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
  10276f:	e9 34 05 00 00       	jmp    102ca8 <__alltraps>

00102774 <vector145>:
.globl vector145
vector145:
  pushl $0
  102774:	6a 00                	push   $0x0
  pushl $145
  102776:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
  10277b:	e9 28 05 00 00       	jmp    102ca8 <__alltraps>

00102780 <vector146>:
.globl vector146
vector146:
  pushl $0
  102780:	6a 00                	push   $0x0
  pushl $146
  102782:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
  102787:	e9 1c 05 00 00       	jmp    102ca8 <__alltraps>

0010278c <vector147>:
.globl vector147
vector147:
  pushl $0
  10278c:	6a 00                	push   $0x0
  pushl $147
  10278e:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
  102793:	e9 10 05 00 00       	jmp    102ca8 <__alltraps>

00102798 <vector148>:
.globl vector148
vector148:
  pushl $0
  102798:	6a 00                	push   $0x0
  pushl $148
  10279a:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
  10279f:	e9 04 05 00 00       	jmp    102ca8 <__alltraps>

001027a4 <vector149>:
.globl vector149
vector149:
  pushl $0
  1027a4:	6a 00                	push   $0x0
  pushl $149
  1027a6:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
  1027ab:	e9 f8 04 00 00       	jmp    102ca8 <__alltraps>

001027b0 <vector150>:
.globl vector150
vector150:
  pushl $0
  1027b0:	6a 00                	push   $0x0
  pushl $150
  1027b2:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
  1027b7:	e9 ec 04 00 00       	jmp    102ca8 <__alltraps>

001027bc <vector151>:
.globl vector151
vector151:
  pushl $0
  1027bc:	6a 00                	push   $0x0
  pushl $151
  1027be:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
  1027c3:	e9 e0 04 00 00       	jmp    102ca8 <__alltraps>

001027c8 <vector152>:
.globl vector152
vector152:
  pushl $0
  1027c8:	6a 00                	push   $0x0
  pushl $152
  1027ca:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
  1027cf:	e9 d4 04 00 00       	jmp    102ca8 <__alltraps>

001027d4 <vector153>:
.globl vector153
vector153:
  pushl $0
  1027d4:	6a 00                	push   $0x0
  pushl $153
  1027d6:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
  1027db:	e9 c8 04 00 00       	jmp    102ca8 <__alltraps>

001027e0 <vector154>:
.globl vector154
vector154:
  pushl $0
  1027e0:	6a 00                	push   $0x0
  pushl $154
  1027e2:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
  1027e7:	e9 bc 04 00 00       	jmp    102ca8 <__alltraps>

001027ec <vector155>:
.globl vector155
vector155:
  pushl $0
  1027ec:	6a 00                	push   $0x0
  pushl $155
  1027ee:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
  1027f3:	e9 b0 04 00 00       	jmp    102ca8 <__alltraps>

001027f8 <vector156>:
.globl vector156
vector156:
  pushl $0
  1027f8:	6a 00                	push   $0x0
  pushl $156
  1027fa:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
  1027ff:	e9 a4 04 00 00       	jmp    102ca8 <__alltraps>

00102804 <vector157>:
.globl vector157
vector157:
  pushl $0
  102804:	6a 00                	push   $0x0
  pushl $157
  102806:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
  10280b:	e9 98 04 00 00       	jmp    102ca8 <__alltraps>

00102810 <vector158>:
.globl vector158
vector158:
  pushl $0
  102810:	6a 00                	push   $0x0
  pushl $158
  102812:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
  102817:	e9 8c 04 00 00       	jmp    102ca8 <__alltraps>

0010281c <vector159>:
.globl vector159
vector159:
  pushl $0
  10281c:	6a 00                	push   $0x0
  pushl $159
  10281e:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
  102823:	e9 80 04 00 00       	jmp    102ca8 <__alltraps>

00102828 <vector160>:
.globl vector160
vector160:
  pushl $0
  102828:	6a 00                	push   $0x0
  pushl $160
  10282a:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
  10282f:	e9 74 04 00 00       	jmp    102ca8 <__alltraps>

00102834 <vector161>:
.globl vector161
vector161:
  pushl $0
  102834:	6a 00                	push   $0x0
  pushl $161
  102836:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
  10283b:	e9 68 04 00 00       	jmp    102ca8 <__alltraps>

00102840 <vector162>:
.globl vector162
vector162:
  pushl $0
  102840:	6a 00                	push   $0x0
  pushl $162
  102842:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
  102847:	e9 5c 04 00 00       	jmp    102ca8 <__alltraps>

0010284c <vector163>:
.globl vector163
vector163:
  pushl $0
  10284c:	6a 00                	push   $0x0
  pushl $163
  10284e:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
  102853:	e9 50 04 00 00       	jmp    102ca8 <__alltraps>

00102858 <vector164>:
.globl vector164
vector164:
  pushl $0
  102858:	6a 00                	push   $0x0
  pushl $164
  10285a:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
  10285f:	e9 44 04 00 00       	jmp    102ca8 <__alltraps>

00102864 <vector165>:
.globl vector165
vector165:
  pushl $0
  102864:	6a 00                	push   $0x0
  pushl $165
  102866:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
  10286b:	e9 38 04 00 00       	jmp    102ca8 <__alltraps>

00102870 <vector166>:
.globl vector166
vector166:
  pushl $0
  102870:	6a 00                	push   $0x0
  pushl $166
  102872:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
  102877:	e9 2c 04 00 00       	jmp    102ca8 <__alltraps>

0010287c <vector167>:
.globl vector167
vector167:
  pushl $0
  10287c:	6a 00                	push   $0x0
  pushl $167
  10287e:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
  102883:	e9 20 04 00 00       	jmp    102ca8 <__alltraps>

00102888 <vector168>:
.globl vector168
vector168:
  pushl $0
  102888:	6a 00                	push   $0x0
  pushl $168
  10288a:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
  10288f:	e9 14 04 00 00       	jmp    102ca8 <__alltraps>

00102894 <vector169>:
.globl vector169
vector169:
  pushl $0
  102894:	6a 00                	push   $0x0
  pushl $169
  102896:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
  10289b:	e9 08 04 00 00       	jmp    102ca8 <__alltraps>

001028a0 <vector170>:
.globl vector170
vector170:
  pushl $0
  1028a0:	6a 00                	push   $0x0
  pushl $170
  1028a2:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
  1028a7:	e9 fc 03 00 00       	jmp    102ca8 <__alltraps>

001028ac <vector171>:
.globl vector171
vector171:
  pushl $0
  1028ac:	6a 00                	push   $0x0
  pushl $171
  1028ae:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
  1028b3:	e9 f0 03 00 00       	jmp    102ca8 <__alltraps>

001028b8 <vector172>:
.globl vector172
vector172:
  pushl $0
  1028b8:	6a 00                	push   $0x0
  pushl $172
  1028ba:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
  1028bf:	e9 e4 03 00 00       	jmp    102ca8 <__alltraps>

001028c4 <vector173>:
.globl vector173
vector173:
  pushl $0
  1028c4:	6a 00                	push   $0x0
  pushl $173
  1028c6:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
  1028cb:	e9 d8 03 00 00       	jmp    102ca8 <__alltraps>

001028d0 <vector174>:
.globl vector174
vector174:
  pushl $0
  1028d0:	6a 00                	push   $0x0
  pushl $174
  1028d2:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
  1028d7:	e9 cc 03 00 00       	jmp    102ca8 <__alltraps>

001028dc <vector175>:
.globl vector175
vector175:
  pushl $0
  1028dc:	6a 00                	push   $0x0
  pushl $175
  1028de:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
  1028e3:	e9 c0 03 00 00       	jmp    102ca8 <__alltraps>

001028e8 <vector176>:
.globl vector176
vector176:
  pushl $0
  1028e8:	6a 00                	push   $0x0
  pushl $176
  1028ea:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
  1028ef:	e9 b4 03 00 00       	jmp    102ca8 <__alltraps>

001028f4 <vector177>:
.globl vector177
vector177:
  pushl $0
  1028f4:	6a 00                	push   $0x0
  pushl $177
  1028f6:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
  1028fb:	e9 a8 03 00 00       	jmp    102ca8 <__alltraps>

00102900 <vector178>:
.globl vector178
vector178:
  pushl $0
  102900:	6a 00                	push   $0x0
  pushl $178
  102902:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
  102907:	e9 9c 03 00 00       	jmp    102ca8 <__alltraps>

0010290c <vector179>:
.globl vector179
vector179:
  pushl $0
  10290c:	6a 00                	push   $0x0
  pushl $179
  10290e:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
  102913:	e9 90 03 00 00       	jmp    102ca8 <__alltraps>

00102918 <vector180>:
.globl vector180
vector180:
  pushl $0
  102918:	6a 00                	push   $0x0
  pushl $180
  10291a:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
  10291f:	e9 84 03 00 00       	jmp    102ca8 <__alltraps>

00102924 <vector181>:
.globl vector181
vector181:
  pushl $0
  102924:	6a 00                	push   $0x0
  pushl $181
  102926:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
  10292b:	e9 78 03 00 00       	jmp    102ca8 <__alltraps>

00102930 <vector182>:
.globl vector182
vector182:
  pushl $0
  102930:	6a 00                	push   $0x0
  pushl $182
  102932:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
  102937:	e9 6c 03 00 00       	jmp    102ca8 <__alltraps>

0010293c <vector183>:
.globl vector183
vector183:
  pushl $0
  10293c:	6a 00                	push   $0x0
  pushl $183
  10293e:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
  102943:	e9 60 03 00 00       	jmp    102ca8 <__alltraps>

00102948 <vector184>:
.globl vector184
vector184:
  pushl $0
  102948:	6a 00                	push   $0x0
  pushl $184
  10294a:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
  10294f:	e9 54 03 00 00       	jmp    102ca8 <__alltraps>

00102954 <vector185>:
.globl vector185
vector185:
  pushl $0
  102954:	6a 00                	push   $0x0
  pushl $185
  102956:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
  10295b:	e9 48 03 00 00       	jmp    102ca8 <__alltraps>

00102960 <vector186>:
.globl vector186
vector186:
  pushl $0
  102960:	6a 00                	push   $0x0
  pushl $186
  102962:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
  102967:	e9 3c 03 00 00       	jmp    102ca8 <__alltraps>

0010296c <vector187>:
.globl vector187
vector187:
  pushl $0
  10296c:	6a 00                	push   $0x0
  pushl $187
  10296e:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
  102973:	e9 30 03 00 00       	jmp    102ca8 <__alltraps>

00102978 <vector188>:
.globl vector188
vector188:
  pushl $0
  102978:	6a 00                	push   $0x0
  pushl $188
  10297a:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
  10297f:	e9 24 03 00 00       	jmp    102ca8 <__alltraps>

00102984 <vector189>:
.globl vector189
vector189:
  pushl $0
  102984:	6a 00                	push   $0x0
  pushl $189
  102986:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
  10298b:	e9 18 03 00 00       	jmp    102ca8 <__alltraps>

00102990 <vector190>:
.globl vector190
vector190:
  pushl $0
  102990:	6a 00                	push   $0x0
  pushl $190
  102992:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
  102997:	e9 0c 03 00 00       	jmp    102ca8 <__alltraps>

0010299c <vector191>:
.globl vector191
vector191:
  pushl $0
  10299c:	6a 00                	push   $0x0
  pushl $191
  10299e:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
  1029a3:	e9 00 03 00 00       	jmp    102ca8 <__alltraps>

001029a8 <vector192>:
.globl vector192
vector192:
  pushl $0
  1029a8:	6a 00                	push   $0x0
  pushl $192
  1029aa:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
  1029af:	e9 f4 02 00 00       	jmp    102ca8 <__alltraps>

001029b4 <vector193>:
.globl vector193
vector193:
  pushl $0
  1029b4:	6a 00                	push   $0x0
  pushl $193
  1029b6:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
  1029bb:	e9 e8 02 00 00       	jmp    102ca8 <__alltraps>

001029c0 <vector194>:
.globl vector194
vector194:
  pushl $0
  1029c0:	6a 00                	push   $0x0
  pushl $194
  1029c2:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
  1029c7:	e9 dc 02 00 00       	jmp    102ca8 <__alltraps>

001029cc <vector195>:
.globl vector195
vector195:
  pushl $0
  1029cc:	6a 00                	push   $0x0
  pushl $195
  1029ce:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
  1029d3:	e9 d0 02 00 00       	jmp    102ca8 <__alltraps>

001029d8 <vector196>:
.globl vector196
vector196:
  pushl $0
  1029d8:	6a 00                	push   $0x0
  pushl $196
  1029da:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
  1029df:	e9 c4 02 00 00       	jmp    102ca8 <__alltraps>

001029e4 <vector197>:
.globl vector197
vector197:
  pushl $0
  1029e4:	6a 00                	push   $0x0
  pushl $197
  1029e6:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
  1029eb:	e9 b8 02 00 00       	jmp    102ca8 <__alltraps>

001029f0 <vector198>:
.globl vector198
vector198:
  pushl $0
  1029f0:	6a 00                	push   $0x0
  pushl $198
  1029f2:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
  1029f7:	e9 ac 02 00 00       	jmp    102ca8 <__alltraps>

001029fc <vector199>:
.globl vector199
vector199:
  pushl $0
  1029fc:	6a 00                	push   $0x0
  pushl $199
  1029fe:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
  102a03:	e9 a0 02 00 00       	jmp    102ca8 <__alltraps>

00102a08 <vector200>:
.globl vector200
vector200:
  pushl $0
  102a08:	6a 00                	push   $0x0
  pushl $200
  102a0a:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
  102a0f:	e9 94 02 00 00       	jmp    102ca8 <__alltraps>

00102a14 <vector201>:
.globl vector201
vector201:
  pushl $0
  102a14:	6a 00                	push   $0x0
  pushl $201
  102a16:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
  102a1b:	e9 88 02 00 00       	jmp    102ca8 <__alltraps>

00102a20 <vector202>:
.globl vector202
vector202:
  pushl $0
  102a20:	6a 00                	push   $0x0
  pushl $202
  102a22:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
  102a27:	e9 7c 02 00 00       	jmp    102ca8 <__alltraps>

00102a2c <vector203>:
.globl vector203
vector203:
  pushl $0
  102a2c:	6a 00                	push   $0x0
  pushl $203
  102a2e:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
  102a33:	e9 70 02 00 00       	jmp    102ca8 <__alltraps>

00102a38 <vector204>:
.globl vector204
vector204:
  pushl $0
  102a38:	6a 00                	push   $0x0
  pushl $204
  102a3a:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
  102a3f:	e9 64 02 00 00       	jmp    102ca8 <__alltraps>

00102a44 <vector205>:
.globl vector205
vector205:
  pushl $0
  102a44:	6a 00                	push   $0x0
  pushl $205
  102a46:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
  102a4b:	e9 58 02 00 00       	jmp    102ca8 <__alltraps>

00102a50 <vector206>:
.globl vector206
vector206:
  pushl $0
  102a50:	6a 00                	push   $0x0
  pushl $206
  102a52:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
  102a57:	e9 4c 02 00 00       	jmp    102ca8 <__alltraps>

00102a5c <vector207>:
.globl vector207
vector207:
  pushl $0
  102a5c:	6a 00                	push   $0x0
  pushl $207
  102a5e:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
  102a63:	e9 40 02 00 00       	jmp    102ca8 <__alltraps>

00102a68 <vector208>:
.globl vector208
vector208:
  pushl $0
  102a68:	6a 00                	push   $0x0
  pushl $208
  102a6a:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
  102a6f:	e9 34 02 00 00       	jmp    102ca8 <__alltraps>

00102a74 <vector209>:
.globl vector209
vector209:
  pushl $0
  102a74:	6a 00                	push   $0x0
  pushl $209
  102a76:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
  102a7b:	e9 28 02 00 00       	jmp    102ca8 <__alltraps>

00102a80 <vector210>:
.globl vector210
vector210:
  pushl $0
  102a80:	6a 00                	push   $0x0
  pushl $210
  102a82:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
  102a87:	e9 1c 02 00 00       	jmp    102ca8 <__alltraps>

00102a8c <vector211>:
.globl vector211
vector211:
  pushl $0
  102a8c:	6a 00                	push   $0x0
  pushl $211
  102a8e:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
  102a93:	e9 10 02 00 00       	jmp    102ca8 <__alltraps>

00102a98 <vector212>:
.globl vector212
vector212:
  pushl $0
  102a98:	6a 00                	push   $0x0
  pushl $212
  102a9a:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
  102a9f:	e9 04 02 00 00       	jmp    102ca8 <__alltraps>

00102aa4 <vector213>:
.globl vector213
vector213:
  pushl $0
  102aa4:	6a 00                	push   $0x0
  pushl $213
  102aa6:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
  102aab:	e9 f8 01 00 00       	jmp    102ca8 <__alltraps>

00102ab0 <vector214>:
.globl vector214
vector214:
  pushl $0
  102ab0:	6a 00                	push   $0x0
  pushl $214
  102ab2:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
  102ab7:	e9 ec 01 00 00       	jmp    102ca8 <__alltraps>

00102abc <vector215>:
.globl vector215
vector215:
  pushl $0
  102abc:	6a 00                	push   $0x0
  pushl $215
  102abe:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
  102ac3:	e9 e0 01 00 00       	jmp    102ca8 <__alltraps>

00102ac8 <vector216>:
.globl vector216
vector216:
  pushl $0
  102ac8:	6a 00                	push   $0x0
  pushl $216
  102aca:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
  102acf:	e9 d4 01 00 00       	jmp    102ca8 <__alltraps>

00102ad4 <vector217>:
.globl vector217
vector217:
  pushl $0
  102ad4:	6a 00                	push   $0x0
  pushl $217
  102ad6:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
  102adb:	e9 c8 01 00 00       	jmp    102ca8 <__alltraps>

00102ae0 <vector218>:
.globl vector218
vector218:
  pushl $0
  102ae0:	6a 00                	push   $0x0
  pushl $218
  102ae2:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
  102ae7:	e9 bc 01 00 00       	jmp    102ca8 <__alltraps>

00102aec <vector219>:
.globl vector219
vector219:
  pushl $0
  102aec:	6a 00                	push   $0x0
  pushl $219
  102aee:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
  102af3:	e9 b0 01 00 00       	jmp    102ca8 <__alltraps>

00102af8 <vector220>:
.globl vector220
vector220:
  pushl $0
  102af8:	6a 00                	push   $0x0
  pushl $220
  102afa:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
  102aff:	e9 a4 01 00 00       	jmp    102ca8 <__alltraps>

00102b04 <vector221>:
.globl vector221
vector221:
  pushl $0
  102b04:	6a 00                	push   $0x0
  pushl $221
  102b06:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
  102b0b:	e9 98 01 00 00       	jmp    102ca8 <__alltraps>

00102b10 <vector222>:
.globl vector222
vector222:
  pushl $0
  102b10:	6a 00                	push   $0x0
  pushl $222
  102b12:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
  102b17:	e9 8c 01 00 00       	jmp    102ca8 <__alltraps>

00102b1c <vector223>:
.globl vector223
vector223:
  pushl $0
  102b1c:	6a 00                	push   $0x0
  pushl $223
  102b1e:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
  102b23:	e9 80 01 00 00       	jmp    102ca8 <__alltraps>

00102b28 <vector224>:
.globl vector224
vector224:
  pushl $0
  102b28:	6a 00                	push   $0x0
  pushl $224
  102b2a:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
  102b2f:	e9 74 01 00 00       	jmp    102ca8 <__alltraps>

00102b34 <vector225>:
.globl vector225
vector225:
  pushl $0
  102b34:	6a 00                	push   $0x0
  pushl $225
  102b36:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
  102b3b:	e9 68 01 00 00       	jmp    102ca8 <__alltraps>

00102b40 <vector226>:
.globl vector226
vector226:
  pushl $0
  102b40:	6a 00                	push   $0x0
  pushl $226
  102b42:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
  102b47:	e9 5c 01 00 00       	jmp    102ca8 <__alltraps>

00102b4c <vector227>:
.globl vector227
vector227:
  pushl $0
  102b4c:	6a 00                	push   $0x0
  pushl $227
  102b4e:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
  102b53:	e9 50 01 00 00       	jmp    102ca8 <__alltraps>

00102b58 <vector228>:
.globl vector228
vector228:
  pushl $0
  102b58:	6a 00                	push   $0x0
  pushl $228
  102b5a:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
  102b5f:	e9 44 01 00 00       	jmp    102ca8 <__alltraps>

00102b64 <vector229>:
.globl vector229
vector229:
  pushl $0
  102b64:	6a 00                	push   $0x0
  pushl $229
  102b66:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
  102b6b:	e9 38 01 00 00       	jmp    102ca8 <__alltraps>

00102b70 <vector230>:
.globl vector230
vector230:
  pushl $0
  102b70:	6a 00                	push   $0x0
  pushl $230
  102b72:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
  102b77:	e9 2c 01 00 00       	jmp    102ca8 <__alltraps>

00102b7c <vector231>:
.globl vector231
vector231:
  pushl $0
  102b7c:	6a 00                	push   $0x0
  pushl $231
  102b7e:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
  102b83:	e9 20 01 00 00       	jmp    102ca8 <__alltraps>

00102b88 <vector232>:
.globl vector232
vector232:
  pushl $0
  102b88:	6a 00                	push   $0x0
  pushl $232
  102b8a:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
  102b8f:	e9 14 01 00 00       	jmp    102ca8 <__alltraps>

00102b94 <vector233>:
.globl vector233
vector233:
  pushl $0
  102b94:	6a 00                	push   $0x0
  pushl $233
  102b96:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
  102b9b:	e9 08 01 00 00       	jmp    102ca8 <__alltraps>

00102ba0 <vector234>:
.globl vector234
vector234:
  pushl $0
  102ba0:	6a 00                	push   $0x0
  pushl $234
  102ba2:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
  102ba7:	e9 fc 00 00 00       	jmp    102ca8 <__alltraps>

00102bac <vector235>:
.globl vector235
vector235:
  pushl $0
  102bac:	6a 00                	push   $0x0
  pushl $235
  102bae:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
  102bb3:	e9 f0 00 00 00       	jmp    102ca8 <__alltraps>

00102bb8 <vector236>:
.globl vector236
vector236:
  pushl $0
  102bb8:	6a 00                	push   $0x0
  pushl $236
  102bba:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
  102bbf:	e9 e4 00 00 00       	jmp    102ca8 <__alltraps>

00102bc4 <vector237>:
.globl vector237
vector237:
  pushl $0
  102bc4:	6a 00                	push   $0x0
  pushl $237
  102bc6:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
  102bcb:	e9 d8 00 00 00       	jmp    102ca8 <__alltraps>

00102bd0 <vector238>:
.globl vector238
vector238:
  pushl $0
  102bd0:	6a 00                	push   $0x0
  pushl $238
  102bd2:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
  102bd7:	e9 cc 00 00 00       	jmp    102ca8 <__alltraps>

00102bdc <vector239>:
.globl vector239
vector239:
  pushl $0
  102bdc:	6a 00                	push   $0x0
  pushl $239
  102bde:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
  102be3:	e9 c0 00 00 00       	jmp    102ca8 <__alltraps>

00102be8 <vector240>:
.globl vector240
vector240:
  pushl $0
  102be8:	6a 00                	push   $0x0
  pushl $240
  102bea:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
  102bef:	e9 b4 00 00 00       	jmp    102ca8 <__alltraps>

00102bf4 <vector241>:
.globl vector241
vector241:
  pushl $0
  102bf4:	6a 00                	push   $0x0
  pushl $241
  102bf6:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
  102bfb:	e9 a8 00 00 00       	jmp    102ca8 <__alltraps>

00102c00 <vector242>:
.globl vector242
vector242:
  pushl $0
  102c00:	6a 00                	push   $0x0
  pushl $242
  102c02:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
  102c07:	e9 9c 00 00 00       	jmp    102ca8 <__alltraps>

00102c0c <vector243>:
.globl vector243
vector243:
  pushl $0
  102c0c:	6a 00                	push   $0x0
  pushl $243
  102c0e:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
  102c13:	e9 90 00 00 00       	jmp    102ca8 <__alltraps>

00102c18 <vector244>:
.globl vector244
vector244:
  pushl $0
  102c18:	6a 00                	push   $0x0
  pushl $244
  102c1a:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
  102c1f:	e9 84 00 00 00       	jmp    102ca8 <__alltraps>

00102c24 <vector245>:
.globl vector245
vector245:
  pushl $0
  102c24:	6a 00                	push   $0x0
  pushl $245
  102c26:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
  102c2b:	e9 78 00 00 00       	jmp    102ca8 <__alltraps>

00102c30 <vector246>:
.globl vector246
vector246:
  pushl $0
  102c30:	6a 00                	push   $0x0
  pushl $246
  102c32:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
  102c37:	e9 6c 00 00 00       	jmp    102ca8 <__alltraps>

00102c3c <vector247>:
.globl vector247
vector247:
  pushl $0
  102c3c:	6a 00                	push   $0x0
  pushl $247
  102c3e:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
  102c43:	e9 60 00 00 00       	jmp    102ca8 <__alltraps>

00102c48 <vector248>:
.globl vector248
vector248:
  pushl $0
  102c48:	6a 00                	push   $0x0
  pushl $248
  102c4a:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
  102c4f:	e9 54 00 00 00       	jmp    102ca8 <__alltraps>

00102c54 <vector249>:
.globl vector249
vector249:
  pushl $0
  102c54:	6a 00                	push   $0x0
  pushl $249
  102c56:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
  102c5b:	e9 48 00 00 00       	jmp    102ca8 <__alltraps>

00102c60 <vector250>:
.globl vector250
vector250:
  pushl $0
  102c60:	6a 00                	push   $0x0
  pushl $250
  102c62:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
  102c67:	e9 3c 00 00 00       	jmp    102ca8 <__alltraps>

00102c6c <vector251>:
.globl vector251
vector251:
  pushl $0
  102c6c:	6a 00                	push   $0x0
  pushl $251
  102c6e:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
  102c73:	e9 30 00 00 00       	jmp    102ca8 <__alltraps>

00102c78 <vector252>:
.globl vector252
vector252:
  pushl $0
  102c78:	6a 00                	push   $0x0
  pushl $252
  102c7a:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
  102c7f:	e9 24 00 00 00       	jmp    102ca8 <__alltraps>

00102c84 <vector253>:
.globl vector253
vector253:
  pushl $0
  102c84:	6a 00                	push   $0x0
  pushl $253
  102c86:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
  102c8b:	e9 18 00 00 00       	jmp    102ca8 <__alltraps>

00102c90 <vector254>:
.globl vector254
vector254:
  pushl $0
  102c90:	6a 00                	push   $0x0
  pushl $254
  102c92:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
  102c97:	e9 0c 00 00 00       	jmp    102ca8 <__alltraps>

00102c9c <vector255>:
.globl vector255
vector255:
  pushl $0
  102c9c:	6a 00                	push   $0x0
  pushl $255
  102c9e:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
  102ca3:	e9 00 00 00 00       	jmp    102ca8 <__alltraps>

00102ca8 <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
  102ca8:	1e                   	push   %ds
    pushl %es
  102ca9:	06                   	push   %es
    pushl %fs
  102caa:	0f a0                	push   %fs
    pushl %gs
  102cac:	0f a8                	push   %gs
    pushal
  102cae:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
  102caf:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
  102cb4:	8e d8                	mov    %eax,%ds
    movw %ax, %es
  102cb6:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
  102cb8:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
  102cb9:	e8 60 f5 ff ff       	call   10221e <trap>

    # pop the pushed stack pointer
    popl %esp
  102cbe:	5c                   	pop    %esp

00102cbf <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
  102cbf:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
  102cc0:	0f a9                	pop    %gs
    popl %fs
  102cc2:	0f a1                	pop    %fs
    popl %es
  102cc4:	07                   	pop    %es
    popl %ds
  102cc5:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
  102cc6:	83 c4 08             	add    $0x8,%esp
    iret
  102cc9:	cf                   	iret   

00102cca <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
  102cca:	55                   	push   %ebp
  102ccb:	89 e5                	mov    %esp,%ebp
    return page->ref;
  102ccd:	8b 45 08             	mov    0x8(%ebp),%eax
  102cd0:	8b 00                	mov    (%eax),%eax
}
  102cd2:	5d                   	pop    %ebp
  102cd3:	c3                   	ret    

00102cd4 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
  102cd4:	55                   	push   %ebp
  102cd5:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  102cd7:	8b 45 08             	mov    0x8(%ebp),%eax
  102cda:	8b 55 0c             	mov    0xc(%ebp),%edx
  102cdd:	89 10                	mov    %edx,(%eax)
}
  102cdf:	90                   	nop
  102ce0:	5d                   	pop    %ebp
  102ce1:	c3                   	ret    

00102ce2 <fixsize>:
#define UINT32_MASK(a)          (UINT32_SHR_OR(UINT32_SHR_OR(UINT32_SHR_OR(UINT32_SHR_OR(UINT32_SHR_OR(a,1),2),4),8),16))    
//大于a的一个最小的2^k
#define UINT32_REMAINDER(a)     ((a)&(UINT32_MASK(a)>>1))
#define UINT32_ROUND_DOWN(a)    (UINT32_REMAINDER(a)?((a)-UINT32_REMAINDER(a)):(a))//小于a的最大的2^k

static unsigned fixsize(unsigned size) {
  102ce2:	f3 0f 1e fb          	endbr32 
  102ce6:	55                   	push   %ebp
  102ce7:	89 e5                	mov    %esp,%ebp
  size |= size >> 1;
  102ce9:	8b 45 08             	mov    0x8(%ebp),%eax
  102cec:	d1 e8                	shr    %eax
  102cee:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 2;
  102cf1:	8b 45 08             	mov    0x8(%ebp),%eax
  102cf4:	c1 e8 02             	shr    $0x2,%eax
  102cf7:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 4;
  102cfa:	8b 45 08             	mov    0x8(%ebp),%eax
  102cfd:	c1 e8 04             	shr    $0x4,%eax
  102d00:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 8;
  102d03:	8b 45 08             	mov    0x8(%ebp),%eax
  102d06:	c1 e8 08             	shr    $0x8,%eax
  102d09:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 16;
  102d0c:	8b 45 08             	mov    0x8(%ebp),%eax
  102d0f:	c1 e8 10             	shr    $0x10,%eax
  102d12:	09 45 08             	or     %eax,0x8(%ebp)
  return size+1;
  102d15:	8b 45 08             	mov    0x8(%ebp),%eax
  102d18:	40                   	inc    %eax
}
  102d19:	5d                   	pop    %ebp
  102d1a:	c3                   	ret    

00102d1b <buddy_init>:

struct allocRecord rec[80000];//存放偏移量的数组
int nr_block;//已分配的块数

static void buddy_init()
{
  102d1b:	f3 0f 1e fb          	endbr32 
  102d1f:	55                   	push   %ebp
  102d20:	89 e5                	mov    %esp,%ebp
  102d22:	83 ec 10             	sub    $0x10,%esp
  102d25:	c7 45 fc e0 33 1c 00 	movl   $0x1c33e0,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
  102d2c:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102d2f:	8b 55 fc             	mov    -0x4(%ebp),%edx
  102d32:	89 50 04             	mov    %edx,0x4(%eax)
  102d35:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102d38:	8b 50 04             	mov    0x4(%eax),%edx
  102d3b:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102d3e:	89 10                	mov    %edx,(%eax)
}
  102d40:	90                   	nop
    list_init(&free_list);
    nr_free=0;
  102d41:	c7 05 e8 33 1c 00 00 	movl   $0x0,0x1c33e8
  102d48:	00 00 00 
}
  102d4b:	90                   	nop
  102d4c:	c9                   	leave  
  102d4d:	c3                   	ret    

00102d4e <buddy2_new>:

//初始化二叉树上的节点
void buddy2_new( int size ) {
  102d4e:	f3 0f 1e fb          	endbr32 
  102d52:	55                   	push   %ebp
  102d53:	89 e5                	mov    %esp,%ebp
  102d55:	83 ec 10             	sub    $0x10,%esp
  unsigned node_size;
  int i;
  nr_block=0;
  102d58:	c7 05 c0 6f 12 00 00 	movl   $0x0,0x126fc0
  102d5f:	00 00 00 
  if (size < 1 || !IS_POWER_OF_2(size))
  102d62:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  102d66:	7e 54                	jle    102dbc <buddy2_new+0x6e>
  102d68:	8b 45 08             	mov    0x8(%ebp),%eax
  102d6b:	48                   	dec    %eax
  102d6c:	23 45 08             	and    0x8(%ebp),%eax
  102d6f:	85 c0                	test   %eax,%eax
  102d71:	75 49                	jne    102dbc <buddy2_new+0x6e>
    return;

  root[0].size = size;
  102d73:	8b 45 08             	mov    0x8(%ebp),%eax
  102d76:	a3 e0 6f 12 00       	mov    %eax,0x126fe0
  node_size = size * 2;
  102d7b:	8b 45 08             	mov    0x8(%ebp),%eax
  102d7e:	01 c0                	add    %eax,%eax
  102d80:	89 45 fc             	mov    %eax,-0x4(%ebp)

  for (i = 0; i < 2 * size - 1; ++i) {
  102d83:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
  102d8a:	eb 23                	jmp    102daf <buddy2_new+0x61>
    if (IS_POWER_OF_2(i+1))
  102d8c:	8b 45 f8             	mov    -0x8(%ebp),%eax
  102d8f:	40                   	inc    %eax
  102d90:	23 45 f8             	and    -0x8(%ebp),%eax
  102d93:	85 c0                	test   %eax,%eax
  102d95:	75 08                	jne    102d9f <buddy2_new+0x51>
      node_size /= 2;
  102d97:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102d9a:	d1 e8                	shr    %eax
  102d9c:	89 45 fc             	mov    %eax,-0x4(%ebp)
    root[i].longest = node_size;
  102d9f:	8b 45 f8             	mov    -0x8(%ebp),%eax
  102da2:	8b 55 fc             	mov    -0x4(%ebp),%edx
  102da5:	89 14 c5 e4 6f 12 00 	mov    %edx,0x126fe4(,%eax,8)
  for (i = 0; i < 2 * size - 1; ++i) {
  102dac:	ff 45 f8             	incl   -0x8(%ebp)
  102daf:	8b 45 08             	mov    0x8(%ebp),%eax
  102db2:	01 c0                	add    %eax,%eax
  102db4:	48                   	dec    %eax
  102db5:	39 45 f8             	cmp    %eax,-0x8(%ebp)
  102db8:	7c d2                	jl     102d8c <buddy2_new+0x3e>
  }
  return;
  102dba:	eb 01                	jmp    102dbd <buddy2_new+0x6f>
    return;
  102dbc:	90                   	nop
}
  102dbd:	c9                   	leave  
  102dbe:	c3                   	ret    

00102dbf <buddy_init_memmap>:

//初始化内存映射关系
static void
buddy_init_memmap(struct Page *base, size_t n)
{
  102dbf:	f3 0f 1e fb          	endbr32 
  102dc3:	55                   	push   %ebp
  102dc4:	89 e5                	mov    %esp,%ebp
  102dc6:	56                   	push   %esi
  102dc7:	53                   	push   %ebx
  102dc8:	83 ec 40             	sub    $0x40,%esp
    assert(n>0);
  102dcb:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  102dcf:	75 24                	jne    102df5 <buddy_init_memmap+0x36>
  102dd1:	c7 44 24 0c 50 9c 10 	movl   $0x109c50,0xc(%esp)
  102dd8:	00 
  102dd9:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  102de0:	00 
  102de1:	c7 44 24 04 4f 00 00 	movl   $0x4f,0x4(%esp)
  102de8:	00 
  102de9:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  102df0:	e8 2c d6 ff ff       	call   100421 <__panic>
    struct Page* p=base;
  102df5:	8b 45 08             	mov    0x8(%ebp),%eax
  102df8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for(;p!=base + n;p++)
  102dfb:	e9 df 00 00 00       	jmp    102edf <buddy_init_memmap+0x120>
    {
        assert(PageReserved(p));
  102e00:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e03:	83 c0 04             	add    $0x4,%eax
  102e06:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  102e0d:	89 45 e8             	mov    %eax,-0x18(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  102e10:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102e13:	8b 55 ec             	mov    -0x14(%ebp),%edx
  102e16:	0f a3 10             	bt     %edx,(%eax)
  102e19:	19 c0                	sbb    %eax,%eax
  102e1b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
  102e1e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  102e22:	0f 95 c0             	setne  %al
  102e25:	0f b6 c0             	movzbl %al,%eax
  102e28:	85 c0                	test   %eax,%eax
  102e2a:	75 24                	jne    102e50 <buddy_init_memmap+0x91>
  102e2c:	c7 44 24 0c 7d 9c 10 	movl   $0x109c7d,0xc(%esp)
  102e33:	00 
  102e34:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  102e3b:	00 
  102e3c:	c7 44 24 04 53 00 00 	movl   $0x53,0x4(%esp)
  102e43:	00 
  102e44:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  102e4b:	e8 d1 d5 ff ff       	call   100421 <__panic>
        p->flags = 0;
  102e50:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e53:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        p->property = 1;
  102e5a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e5d:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
        set_page_ref(p, 0);   
  102e64:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  102e6b:	00 
  102e6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e6f:	89 04 24             	mov    %eax,(%esp)
  102e72:	e8 5d fe ff ff       	call   102cd4 <set_page_ref>
        SetPageProperty(p);
  102e77:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e7a:	83 c0 04             	add    $0x4,%eax
  102e7d:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
  102e84:	89 45 c8             	mov    %eax,-0x38(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102e87:	8b 45 c8             	mov    -0x38(%ebp),%eax
  102e8a:	8b 55 cc             	mov    -0x34(%ebp),%edx
  102e8d:	0f ab 10             	bts    %edx,(%eax)
}
  102e90:	90                   	nop
        list_add_before(&free_list,&(p->page_link));     
  102e91:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e94:	83 c0 0c             	add    $0xc,%eax
  102e97:	c7 45 e0 e0 33 1c 00 	movl   $0x1c33e0,-0x20(%ebp)
  102e9e:	89 45 dc             	mov    %eax,-0x24(%ebp)
 * Insert the new element @elm *before* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_before(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm->prev, listelm);
  102ea1:	8b 45 e0             	mov    -0x20(%ebp),%eax
  102ea4:	8b 00                	mov    (%eax),%eax
  102ea6:	8b 55 dc             	mov    -0x24(%ebp),%edx
  102ea9:	89 55 d8             	mov    %edx,-0x28(%ebp)
  102eac:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  102eaf:	8b 45 e0             	mov    -0x20(%ebp),%eax
  102eb2:	89 45 d0             	mov    %eax,-0x30(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
  102eb5:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102eb8:	8b 55 d8             	mov    -0x28(%ebp),%edx
  102ebb:	89 10                	mov    %edx,(%eax)
  102ebd:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102ec0:	8b 10                	mov    (%eax),%edx
  102ec2:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102ec5:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  102ec8:	8b 45 d8             	mov    -0x28(%ebp),%eax
  102ecb:	8b 55 d0             	mov    -0x30(%ebp),%edx
  102ece:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  102ed1:	8b 45 d8             	mov    -0x28(%ebp),%eax
  102ed4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  102ed7:	89 10                	mov    %edx,(%eax)
}
  102ed9:	90                   	nop
}
  102eda:	90                   	nop
    for(;p!=base + n;p++)
  102edb:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
  102edf:	8b 55 0c             	mov    0xc(%ebp),%edx
  102ee2:	89 d0                	mov    %edx,%eax
  102ee4:	c1 e0 03             	shl    $0x3,%eax
  102ee7:	01 d0                	add    %edx,%eax
  102ee9:	c1 e0 02             	shl    $0x2,%eax
  102eec:	89 c2                	mov    %eax,%edx
  102eee:	8b 45 08             	mov    0x8(%ebp),%eax
  102ef1:	01 d0                	add    %edx,%eax
  102ef3:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  102ef6:	0f 85 04 ff ff ff    	jne    102e00 <buddy_init_memmap+0x41>
    }
    nr_free += n;
  102efc:	8b 15 e8 33 1c 00    	mov    0x1c33e8,%edx
  102f02:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f05:	01 d0                	add    %edx,%eax
  102f07:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8
    int allocpages=UINT32_ROUND_DOWN(n);
  102f0c:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f0f:	d1 e8                	shr    %eax
  102f11:	0b 45 0c             	or     0xc(%ebp),%eax
  102f14:	8b 55 0c             	mov    0xc(%ebp),%edx
  102f17:	d1 ea                	shr    %edx
  102f19:	0b 55 0c             	or     0xc(%ebp),%edx
  102f1c:	c1 ea 02             	shr    $0x2,%edx
  102f1f:	09 d0                	or     %edx,%eax
  102f21:	89 c1                	mov    %eax,%ecx
  102f23:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f26:	d1 e8                	shr    %eax
  102f28:	0b 45 0c             	or     0xc(%ebp),%eax
  102f2b:	8b 55 0c             	mov    0xc(%ebp),%edx
  102f2e:	d1 ea                	shr    %edx
  102f30:	0b 55 0c             	or     0xc(%ebp),%edx
  102f33:	c1 ea 02             	shr    $0x2,%edx
  102f36:	09 d0                	or     %edx,%eax
  102f38:	c1 e8 04             	shr    $0x4,%eax
  102f3b:	09 c1                	or     %eax,%ecx
  102f3d:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f40:	d1 e8                	shr    %eax
  102f42:	0b 45 0c             	or     0xc(%ebp),%eax
  102f45:	8b 55 0c             	mov    0xc(%ebp),%edx
  102f48:	d1 ea                	shr    %edx
  102f4a:	0b 55 0c             	or     0xc(%ebp),%edx
  102f4d:	c1 ea 02             	shr    $0x2,%edx
  102f50:	09 d0                	or     %edx,%eax
  102f52:	89 c3                	mov    %eax,%ebx
  102f54:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f57:	d1 e8                	shr    %eax
  102f59:	0b 45 0c             	or     0xc(%ebp),%eax
  102f5c:	8b 55 0c             	mov    0xc(%ebp),%edx
  102f5f:	d1 ea                	shr    %edx
  102f61:	0b 55 0c             	or     0xc(%ebp),%edx
  102f64:	c1 ea 02             	shr    $0x2,%edx
  102f67:	09 d0                	or     %edx,%eax
  102f69:	c1 e8 04             	shr    $0x4,%eax
  102f6c:	09 d8                	or     %ebx,%eax
  102f6e:	c1 e8 08             	shr    $0x8,%eax
  102f71:	09 c1                	or     %eax,%ecx
  102f73:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f76:	d1 e8                	shr    %eax
  102f78:	0b 45 0c             	or     0xc(%ebp),%eax
  102f7b:	8b 55 0c             	mov    0xc(%ebp),%edx
  102f7e:	d1 ea                	shr    %edx
  102f80:	0b 55 0c             	or     0xc(%ebp),%edx
  102f83:	c1 ea 02             	shr    $0x2,%edx
  102f86:	09 d0                	or     %edx,%eax
  102f88:	89 c3                	mov    %eax,%ebx
  102f8a:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f8d:	d1 e8                	shr    %eax
  102f8f:	0b 45 0c             	or     0xc(%ebp),%eax
  102f92:	8b 55 0c             	mov    0xc(%ebp),%edx
  102f95:	d1 ea                	shr    %edx
  102f97:	0b 55 0c             	or     0xc(%ebp),%edx
  102f9a:	c1 ea 02             	shr    $0x2,%edx
  102f9d:	09 d0                	or     %edx,%eax
  102f9f:	c1 e8 04             	shr    $0x4,%eax
  102fa2:	09 c3                	or     %eax,%ebx
  102fa4:	8b 45 0c             	mov    0xc(%ebp),%eax
  102fa7:	d1 e8                	shr    %eax
  102fa9:	0b 45 0c             	or     0xc(%ebp),%eax
  102fac:	8b 55 0c             	mov    0xc(%ebp),%edx
  102faf:	d1 ea                	shr    %edx
  102fb1:	0b 55 0c             	or     0xc(%ebp),%edx
  102fb4:	c1 ea 02             	shr    $0x2,%edx
  102fb7:	09 d0                	or     %edx,%eax
  102fb9:	89 c6                	mov    %eax,%esi
  102fbb:	8b 45 0c             	mov    0xc(%ebp),%eax
  102fbe:	d1 e8                	shr    %eax
  102fc0:	0b 45 0c             	or     0xc(%ebp),%eax
  102fc3:	8b 55 0c             	mov    0xc(%ebp),%edx
  102fc6:	d1 ea                	shr    %edx
  102fc8:	0b 55 0c             	or     0xc(%ebp),%edx
  102fcb:	c1 ea 02             	shr    $0x2,%edx
  102fce:	09 d0                	or     %edx,%eax
  102fd0:	c1 e8 04             	shr    $0x4,%eax
  102fd3:	09 f0                	or     %esi,%eax
  102fd5:	c1 e8 08             	shr    $0x8,%eax
  102fd8:	09 d8                	or     %ebx,%eax
  102fda:	c1 e8 10             	shr    $0x10,%eax
  102fdd:	09 c8                	or     %ecx,%eax
  102fdf:	d1 e8                	shr    %eax
  102fe1:	23 45 0c             	and    0xc(%ebp),%eax
  102fe4:	85 c0                	test   %eax,%eax
  102fe6:	0f 84 dc 00 00 00    	je     1030c8 <buddy_init_memmap+0x309>
  102fec:	8b 45 0c             	mov    0xc(%ebp),%eax
  102fef:	d1 e8                	shr    %eax
  102ff1:	0b 45 0c             	or     0xc(%ebp),%eax
  102ff4:	8b 55 0c             	mov    0xc(%ebp),%edx
  102ff7:	d1 ea                	shr    %edx
  102ff9:	0b 55 0c             	or     0xc(%ebp),%edx
  102ffc:	c1 ea 02             	shr    $0x2,%edx
  102fff:	09 d0                	or     %edx,%eax
  103001:	89 c1                	mov    %eax,%ecx
  103003:	8b 45 0c             	mov    0xc(%ebp),%eax
  103006:	d1 e8                	shr    %eax
  103008:	0b 45 0c             	or     0xc(%ebp),%eax
  10300b:	8b 55 0c             	mov    0xc(%ebp),%edx
  10300e:	d1 ea                	shr    %edx
  103010:	0b 55 0c             	or     0xc(%ebp),%edx
  103013:	c1 ea 02             	shr    $0x2,%edx
  103016:	09 d0                	or     %edx,%eax
  103018:	c1 e8 04             	shr    $0x4,%eax
  10301b:	09 c1                	or     %eax,%ecx
  10301d:	8b 45 0c             	mov    0xc(%ebp),%eax
  103020:	d1 e8                	shr    %eax
  103022:	0b 45 0c             	or     0xc(%ebp),%eax
  103025:	8b 55 0c             	mov    0xc(%ebp),%edx
  103028:	d1 ea                	shr    %edx
  10302a:	0b 55 0c             	or     0xc(%ebp),%edx
  10302d:	c1 ea 02             	shr    $0x2,%edx
  103030:	09 d0                	or     %edx,%eax
  103032:	89 c3                	mov    %eax,%ebx
  103034:	8b 45 0c             	mov    0xc(%ebp),%eax
  103037:	d1 e8                	shr    %eax
  103039:	0b 45 0c             	or     0xc(%ebp),%eax
  10303c:	8b 55 0c             	mov    0xc(%ebp),%edx
  10303f:	d1 ea                	shr    %edx
  103041:	0b 55 0c             	or     0xc(%ebp),%edx
  103044:	c1 ea 02             	shr    $0x2,%edx
  103047:	09 d0                	or     %edx,%eax
  103049:	c1 e8 04             	shr    $0x4,%eax
  10304c:	09 d8                	or     %ebx,%eax
  10304e:	c1 e8 08             	shr    $0x8,%eax
  103051:	09 c1                	or     %eax,%ecx
  103053:	8b 45 0c             	mov    0xc(%ebp),%eax
  103056:	d1 e8                	shr    %eax
  103058:	0b 45 0c             	or     0xc(%ebp),%eax
  10305b:	8b 55 0c             	mov    0xc(%ebp),%edx
  10305e:	d1 ea                	shr    %edx
  103060:	0b 55 0c             	or     0xc(%ebp),%edx
  103063:	c1 ea 02             	shr    $0x2,%edx
  103066:	09 d0                	or     %edx,%eax
  103068:	89 c3                	mov    %eax,%ebx
  10306a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10306d:	d1 e8                	shr    %eax
  10306f:	0b 45 0c             	or     0xc(%ebp),%eax
  103072:	8b 55 0c             	mov    0xc(%ebp),%edx
  103075:	d1 ea                	shr    %edx
  103077:	0b 55 0c             	or     0xc(%ebp),%edx
  10307a:	c1 ea 02             	shr    $0x2,%edx
  10307d:	09 d0                	or     %edx,%eax
  10307f:	c1 e8 04             	shr    $0x4,%eax
  103082:	09 c3                	or     %eax,%ebx
  103084:	8b 45 0c             	mov    0xc(%ebp),%eax
  103087:	d1 e8                	shr    %eax
  103089:	0b 45 0c             	or     0xc(%ebp),%eax
  10308c:	8b 55 0c             	mov    0xc(%ebp),%edx
  10308f:	d1 ea                	shr    %edx
  103091:	0b 55 0c             	or     0xc(%ebp),%edx
  103094:	c1 ea 02             	shr    $0x2,%edx
  103097:	09 d0                	or     %edx,%eax
  103099:	89 c6                	mov    %eax,%esi
  10309b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10309e:	d1 e8                	shr    %eax
  1030a0:	0b 45 0c             	or     0xc(%ebp),%eax
  1030a3:	8b 55 0c             	mov    0xc(%ebp),%edx
  1030a6:	d1 ea                	shr    %edx
  1030a8:	0b 55 0c             	or     0xc(%ebp),%edx
  1030ab:	c1 ea 02             	shr    $0x2,%edx
  1030ae:	09 d0                	or     %edx,%eax
  1030b0:	c1 e8 04             	shr    $0x4,%eax
  1030b3:	09 f0                	or     %esi,%eax
  1030b5:	c1 e8 08             	shr    $0x8,%eax
  1030b8:	09 d8                	or     %ebx,%eax
  1030ba:	c1 e8 10             	shr    $0x10,%eax
  1030bd:	09 c8                	or     %ecx,%eax
  1030bf:	d1 e8                	shr    %eax
  1030c1:	f7 d0                	not    %eax
  1030c3:	23 45 0c             	and    0xc(%ebp),%eax
  1030c6:	eb 03                	jmp    1030cb <buddy_init_memmap+0x30c>
  1030c8:	8b 45 0c             	mov    0xc(%ebp),%eax
  1030cb:	89 45 f0             	mov    %eax,-0x10(%ebp)
    buddy2_new(allocpages);
  1030ce:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1030d1:	89 04 24             	mov    %eax,(%esp)
  1030d4:	e8 75 fc ff ff       	call   102d4e <buddy2_new>
}
  1030d9:	90                   	nop
  1030da:	83 c4 40             	add    $0x40,%esp
  1030dd:	5b                   	pop    %ebx
  1030de:	5e                   	pop    %esi
  1030df:	5d                   	pop    %ebp
  1030e0:	c3                   	ret    

001030e1 <buddy2_alloc>:
//内存分配
int buddy2_alloc(struct buddy2* self, int size) {
  1030e1:	f3 0f 1e fb          	endbr32 
  1030e5:	55                   	push   %ebp
  1030e6:	89 e5                	mov    %esp,%ebp
  1030e8:	53                   	push   %ebx
  1030e9:	83 ec 14             	sub    $0x14,%esp
  unsigned index = 0;//节点的标号
  1030ec:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
  unsigned node_size;
  unsigned offset = 0;
  1030f3:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)

  if (self==NULL)//无法分配
  1030fa:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  1030fe:	75 0a                	jne    10310a <buddy2_alloc+0x29>
    return -1;
  103100:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  103105:	e9 63 01 00 00       	jmp    10326d <buddy2_alloc+0x18c>

  if (size <= 0)//分配不合理
  10310a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  10310e:	7f 09                	jg     103119 <buddy2_alloc+0x38>
    size = 1;
  103110:	c7 45 0c 01 00 00 00 	movl   $0x1,0xc(%ebp)
  103117:	eb 19                	jmp    103132 <buddy2_alloc+0x51>
  else if (!IS_POWER_OF_2(size))//不为2的幂时，取比size更大的2的n次幂
  103119:	8b 45 0c             	mov    0xc(%ebp),%eax
  10311c:	48                   	dec    %eax
  10311d:	23 45 0c             	and    0xc(%ebp),%eax
  103120:	85 c0                	test   %eax,%eax
  103122:	74 0e                	je     103132 <buddy2_alloc+0x51>
    size = fixsize(size);
  103124:	8b 45 0c             	mov    0xc(%ebp),%eax
  103127:	89 04 24             	mov    %eax,(%esp)
  10312a:	e8 b3 fb ff ff       	call   102ce2 <fixsize>
  10312f:	89 45 0c             	mov    %eax,0xc(%ebp)

  if (self[index].longest < size)//可分配内存不足
  103132:	8b 45 f8             	mov    -0x8(%ebp),%eax
  103135:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
  10313c:	8b 45 08             	mov    0x8(%ebp),%eax
  10313f:	01 d0                	add    %edx,%eax
  103141:	8b 50 04             	mov    0x4(%eax),%edx
  103144:	8b 45 0c             	mov    0xc(%ebp),%eax
  103147:	39 c2                	cmp    %eax,%edx
  103149:	73 0a                	jae    103155 <buddy2_alloc+0x74>
    return -1;
  10314b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  103150:	e9 18 01 00 00       	jmp    10326d <buddy2_alloc+0x18c>

  for(node_size = self->size; node_size != size; node_size /= 2 ) {
  103155:	8b 45 08             	mov    0x8(%ebp),%eax
  103158:	8b 00                	mov    (%eax),%eax
  10315a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10315d:	e9 85 00 00 00       	jmp    1031e7 <buddy2_alloc+0x106>
    if (self[LEFT_LEAF(index)].longest >= size)
  103162:	8b 45 f8             	mov    -0x8(%ebp),%eax
  103165:	c1 e0 04             	shl    $0x4,%eax
  103168:	8d 50 08             	lea    0x8(%eax),%edx
  10316b:	8b 45 08             	mov    0x8(%ebp),%eax
  10316e:	01 d0                	add    %edx,%eax
  103170:	8b 50 04             	mov    0x4(%eax),%edx
  103173:	8b 45 0c             	mov    0xc(%ebp),%eax
  103176:	39 c2                	cmp    %eax,%edx
  103178:	72 5c                	jb     1031d6 <buddy2_alloc+0xf5>
    {
       if(self[RIGHT_LEAF(index)].longest>=size)
  10317a:	8b 45 f8             	mov    -0x8(%ebp),%eax
  10317d:	40                   	inc    %eax
  10317e:	c1 e0 04             	shl    $0x4,%eax
  103181:	89 c2                	mov    %eax,%edx
  103183:	8b 45 08             	mov    0x8(%ebp),%eax
  103186:	01 d0                	add    %edx,%eax
  103188:	8b 50 04             	mov    0x4(%eax),%edx
  10318b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10318e:	39 c2                	cmp    %eax,%edx
  103190:	72 39                	jb     1031cb <buddy2_alloc+0xea>
        {
           index=self[LEFT_LEAF(index)].longest <= self[RIGHT_LEAF(index)].longest? LEFT_LEAF(index):RIGHT_LEAF(index);
  103192:	8b 45 f8             	mov    -0x8(%ebp),%eax
  103195:	c1 e0 04             	shl    $0x4,%eax
  103198:	8d 50 08             	lea    0x8(%eax),%edx
  10319b:	8b 45 08             	mov    0x8(%ebp),%eax
  10319e:	01 d0                	add    %edx,%eax
  1031a0:	8b 50 04             	mov    0x4(%eax),%edx
  1031a3:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1031a6:	40                   	inc    %eax
  1031a7:	c1 e0 04             	shl    $0x4,%eax
  1031aa:	89 c1                	mov    %eax,%ecx
  1031ac:	8b 45 08             	mov    0x8(%ebp),%eax
  1031af:	01 c8                	add    %ecx,%eax
  1031b1:	8b 40 04             	mov    0x4(%eax),%eax
  1031b4:	39 c2                	cmp    %eax,%edx
  1031b6:	77 08                	ja     1031c0 <buddy2_alloc+0xdf>
  1031b8:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1031bb:	01 c0                	add    %eax,%eax
  1031bd:	40                   	inc    %eax
  1031be:	eb 06                	jmp    1031c6 <buddy2_alloc+0xe5>
  1031c0:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1031c3:	40                   	inc    %eax
  1031c4:	01 c0                	add    %eax,%eax
  1031c6:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1031c9:	eb 14                	jmp    1031df <buddy2_alloc+0xfe>
         //找到两个相符合的节点中内存较小的结点
        }
       else
       {
         index=LEFT_LEAF(index);
  1031cb:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1031ce:	01 c0                	add    %eax,%eax
  1031d0:	40                   	inc    %eax
  1031d1:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1031d4:	eb 09                	jmp    1031df <buddy2_alloc+0xfe>
       }  
    }
    else
      index = RIGHT_LEAF(index);
  1031d6:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1031d9:	40                   	inc    %eax
  1031da:	01 c0                	add    %eax,%eax
  1031dc:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(node_size = self->size; node_size != size; node_size /= 2 ) {
  1031df:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1031e2:	d1 e8                	shr    %eax
  1031e4:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1031e7:	8b 45 0c             	mov    0xc(%ebp),%eax
  1031ea:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  1031ed:	0f 85 6f ff ff ff    	jne    103162 <buddy2_alloc+0x81>
  }

  self[index].longest = 0;//标记节点为已使用
  1031f3:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1031f6:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
  1031fd:	8b 45 08             	mov    0x8(%ebp),%eax
  103200:	01 d0                	add    %edx,%eax
  103202:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
  offset = (index + 1) * node_size - self->size;
  103209:	8b 45 f8             	mov    -0x8(%ebp),%eax
  10320c:	40                   	inc    %eax
  10320d:	0f af 45 f4          	imul   -0xc(%ebp),%eax
  103211:	89 c2                	mov    %eax,%edx
  103213:	8b 45 08             	mov    0x8(%ebp),%eax
  103216:	8b 00                	mov    (%eax),%eax
  103218:	29 c2                	sub    %eax,%edx
  10321a:	89 d0                	mov    %edx,%eax
  10321c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  while (index) {
  10321f:	eb 43                	jmp    103264 <buddy2_alloc+0x183>
    index = PARENT(index);
  103221:	8b 45 f8             	mov    -0x8(%ebp),%eax
  103224:	40                   	inc    %eax
  103225:	d1 e8                	shr    %eax
  103227:	48                   	dec    %eax
  103228:	89 45 f8             	mov    %eax,-0x8(%ebp)
    self[index].longest = 
      MAX(self[LEFT_LEAF(index)].longest, self[RIGHT_LEAF(index)].longest);
  10322b:	8b 45 f8             	mov    -0x8(%ebp),%eax
  10322e:	40                   	inc    %eax
  10322f:	c1 e0 04             	shl    $0x4,%eax
  103232:	89 c2                	mov    %eax,%edx
  103234:	8b 45 08             	mov    0x8(%ebp),%eax
  103237:	01 d0                	add    %edx,%eax
  103239:	8b 50 04             	mov    0x4(%eax),%edx
  10323c:	8b 45 f8             	mov    -0x8(%ebp),%eax
  10323f:	c1 e0 04             	shl    $0x4,%eax
  103242:	8d 48 08             	lea    0x8(%eax),%ecx
  103245:	8b 45 08             	mov    0x8(%ebp),%eax
  103248:	01 c8                	add    %ecx,%eax
  10324a:	8b 40 04             	mov    0x4(%eax),%eax
    self[index].longest = 
  10324d:	8b 4d f8             	mov    -0x8(%ebp),%ecx
  103250:	8d 1c cd 00 00 00 00 	lea    0x0(,%ecx,8),%ebx
  103257:	8b 4d 08             	mov    0x8(%ebp),%ecx
  10325a:	01 d9                	add    %ebx,%ecx
      MAX(self[LEFT_LEAF(index)].longest, self[RIGHT_LEAF(index)].longest);
  10325c:	39 c2                	cmp    %eax,%edx
  10325e:	0f 43 c2             	cmovae %edx,%eax
    self[index].longest = 
  103261:	89 41 04             	mov    %eax,0x4(%ecx)
  while (index) {
  103264:	83 7d f8 00          	cmpl   $0x0,-0x8(%ebp)
  103268:	75 b7                	jne    103221 <buddy2_alloc+0x140>
  }
//向上刷新，修改先祖结点的数值
  return offset;
  10326a:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  10326d:	83 c4 14             	add    $0x14,%esp
  103270:	5b                   	pop    %ebx
  103271:	5d                   	pop    %ebp
  103272:	c3                   	ret    

00103273 <buddy_alloc_pages>:

static struct Page*
buddy_alloc_pages(size_t n){
  103273:	f3 0f 1e fb          	endbr32 
  103277:	55                   	push   %ebp
  103278:	89 e5                	mov    %esp,%ebp
  10327a:	53                   	push   %ebx
  10327b:	83 ec 44             	sub    $0x44,%esp
  assert(n>0);
  10327e:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  103282:	75 24                	jne    1032a8 <buddy_alloc_pages+0x35>
  103284:	c7 44 24 0c 50 9c 10 	movl   $0x109c50,0xc(%esp)
  10328b:	00 
  10328c:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  103293:	00 
  103294:	c7 44 24 04 8d 00 00 	movl   $0x8d,0x4(%esp)
  10329b:	00 
  10329c:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  1032a3:	e8 79 d1 ff ff       	call   100421 <__panic>
  if(n>nr_free)
  1032a8:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  1032ad:	39 45 08             	cmp    %eax,0x8(%ebp)
  1032b0:	76 0a                	jbe    1032bc <buddy_alloc_pages+0x49>
   return NULL;
  1032b2:	b8 00 00 00 00       	mov    $0x0,%eax
  1032b7:	e9 41 01 00 00       	jmp    1033fd <buddy_alloc_pages+0x18a>
  struct Page* page=NULL;
  1032bc:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  struct Page* p;
  list_entry_t *le=&free_list,*len;
  1032c3:	c7 45 f4 e0 33 1c 00 	movl   $0x1c33e0,-0xc(%ebp)
  rec[nr_block].offset=buddy2_alloc(root,n);//记录偏移量
  1032ca:	8b 45 08             	mov    0x8(%ebp),%eax
  1032cd:	8b 1d c0 6f 12 00    	mov    0x126fc0,%ebx
  1032d3:	89 44 24 04          	mov    %eax,0x4(%esp)
  1032d7:	c7 04 24 e0 6f 12 00 	movl   $0x126fe0,(%esp)
  1032de:	e8 fe fd ff ff       	call   1030e1 <buddy2_alloc>
  1032e3:	89 c2                	mov    %eax,%edx
  1032e5:	89 d8                	mov    %ebx,%eax
  1032e7:	01 c0                	add    %eax,%eax
  1032e9:	01 d8                	add    %ebx,%eax
  1032eb:	c1 e0 02             	shl    $0x2,%eax
  1032ee:	05 04 34 1c 00       	add    $0x1c3404,%eax
  1032f3:	89 10                	mov    %edx,(%eax)
  int i;
  for(i=0;i<rec[nr_block].offset+1;i++)
  1032f5:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  1032fc:	eb 12                	jmp    103310 <buddy_alloc_pages+0x9d>
  1032fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103301:	89 45 dc             	mov    %eax,-0x24(%ebp)
    return listelm->next;
  103304:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103307:	8b 40 04             	mov    0x4(%eax),%eax
    le=list_next(le);
  10330a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  for(i=0;i<rec[nr_block].offset+1;i++)
  10330d:	ff 45 f0             	incl   -0x10(%ebp)
  103310:	8b 15 c0 6f 12 00    	mov    0x126fc0,%edx
  103316:	89 d0                	mov    %edx,%eax
  103318:	01 c0                	add    %eax,%eax
  10331a:	01 d0                	add    %edx,%eax
  10331c:	c1 e0 02             	shl    $0x2,%eax
  10331f:	05 04 34 1c 00       	add    $0x1c3404,%eax
  103324:	8b 00                	mov    (%eax),%eax
  103326:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  103329:	7e d3                	jle    1032fe <buddy_alloc_pages+0x8b>
  page=le2page(le,page_link);
  10332b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10332e:	83 e8 0c             	sub    $0xc,%eax
  103331:	89 45 e8             	mov    %eax,-0x18(%ebp)
  int allocpages;
  if(!IS_POWER_OF_2(n))
  103334:	8b 45 08             	mov    0x8(%ebp),%eax
  103337:	48                   	dec    %eax
  103338:	23 45 08             	and    0x8(%ebp),%eax
  10333b:	85 c0                	test   %eax,%eax
  10333d:	74 10                	je     10334f <buddy_alloc_pages+0xdc>
   allocpages=fixsize(n);
  10333f:	8b 45 08             	mov    0x8(%ebp),%eax
  103342:	89 04 24             	mov    %eax,(%esp)
  103345:	e8 98 f9 ff ff       	call   102ce2 <fixsize>
  10334a:	89 45 ec             	mov    %eax,-0x14(%ebp)
  10334d:	eb 06                	jmp    103355 <buddy_alloc_pages+0xe2>
  else
  {
     allocpages=n;
  10334f:	8b 45 08             	mov    0x8(%ebp),%eax
  103352:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }
  //根据需求n得到块大小
  rec[nr_block].base=page;//记录分配块首页
  103355:	8b 15 c0 6f 12 00    	mov    0x126fc0,%edx
  10335b:	89 d0                	mov    %edx,%eax
  10335d:	01 c0                	add    %eax,%eax
  10335f:	01 d0                	add    %edx,%eax
  103361:	c1 e0 02             	shl    $0x2,%eax
  103364:	8d 90 00 34 1c 00    	lea    0x1c3400(%eax),%edx
  10336a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10336d:	89 02                	mov    %eax,(%edx)
  rec[nr_block].nr=allocpages;//记录分配的页数
  10336f:	8b 15 c0 6f 12 00    	mov    0x126fc0,%edx
  103375:	8b 4d ec             	mov    -0x14(%ebp),%ecx
  103378:	89 d0                	mov    %edx,%eax
  10337a:	01 c0                	add    %eax,%eax
  10337c:	01 d0                	add    %edx,%eax
  10337e:	c1 e0 02             	shl    $0x2,%eax
  103381:	05 08 34 1c 00       	add    $0x1c3408,%eax
  103386:	89 08                	mov    %ecx,(%eax)
  nr_block++;
  103388:	a1 c0 6f 12 00       	mov    0x126fc0,%eax
  10338d:	40                   	inc    %eax
  10338e:	a3 c0 6f 12 00       	mov    %eax,0x126fc0
  for(i=0;i<allocpages;i++)
  103393:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  10339a:	eb 3b                	jmp    1033d7 <buddy_alloc_pages+0x164>
  10339c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10339f:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1033a2:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1033a5:	8b 40 04             	mov    0x4(%eax),%eax
  {
    len=list_next(le);
  1033a8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    p=le2page(le,page_link);
  1033ab:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1033ae:	83 e8 0c             	sub    $0xc,%eax
  1033b1:	89 45 e0             	mov    %eax,-0x20(%ebp)
    ClearPageProperty(p);
  1033b4:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1033b7:	83 c0 04             	add    $0x4,%eax
  1033ba:	c7 45 d8 01 00 00 00 	movl   $0x1,-0x28(%ebp)
  1033c1:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  1033c4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1033c7:	8b 55 d8             	mov    -0x28(%ebp),%edx
  1033ca:	0f b3 10             	btr    %edx,(%eax)
}
  1033cd:	90                   	nop
    le=len;
  1033ce:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1033d1:	89 45 f4             	mov    %eax,-0xc(%ebp)
  for(i=0;i<allocpages;i++)
  1033d4:	ff 45 f0             	incl   -0x10(%ebp)
  1033d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1033da:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  1033dd:	7c bd                	jl     10339c <buddy_alloc_pages+0x129>
  }//修改每一页的状态
  nr_free-=allocpages;//减去已被分配的页数
  1033df:	8b 15 e8 33 1c 00    	mov    0x1c33e8,%edx
  1033e5:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1033e8:	29 c2                	sub    %eax,%edx
  1033ea:	89 d0                	mov    %edx,%eax
  1033ec:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8
  page->property=n;
  1033f1:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1033f4:	8b 55 08             	mov    0x8(%ebp),%edx
  1033f7:	89 50 08             	mov    %edx,0x8(%eax)
  return page;
  1033fa:	8b 45 e8             	mov    -0x18(%ebp),%eax
}
  1033fd:	83 c4 44             	add    $0x44,%esp
  103400:	5b                   	pop    %ebx
  103401:	5d                   	pop    %ebp
  103402:	c3                   	ret    

00103403 <buddy_free_pages>:

void buddy_free_pages(struct Page* base, size_t n) {
  103403:	f3 0f 1e fb          	endbr32 
  103407:	55                   	push   %ebp
  103408:	89 e5                	mov    %esp,%ebp
  10340a:	83 ec 58             	sub    $0x58,%esp
  unsigned node_size, index = 0;
  10340d:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  unsigned left_longest, right_longest;
  struct buddy2* self=root;
  103414:	c7 45 e0 e0 6f 12 00 	movl   $0x126fe0,-0x20(%ebp)
  10341b:	c7 45 c8 e0 33 1c 00 	movl   $0x1c33e0,-0x38(%ebp)
  103422:	8b 45 c8             	mov    -0x38(%ebp),%eax
  103425:	8b 40 04             	mov    0x4(%eax),%eax
  
  list_entry_t *le=list_next(&free_list);
  103428:	89 45 ec             	mov    %eax,-0x14(%ebp)
  int i=0;
  10342b:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  for(i=0;i<nr_block;i++)//找到块
  103432:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  103439:	eb 1b                	jmp    103456 <buddy_free_pages+0x53>
  {
    if(rec[i].base==base)
  10343b:	8b 55 e8             	mov    -0x18(%ebp),%edx
  10343e:	89 d0                	mov    %edx,%eax
  103440:	01 c0                	add    %eax,%eax
  103442:	01 d0                	add    %edx,%eax
  103444:	c1 e0 02             	shl    $0x2,%eax
  103447:	05 00 34 1c 00       	add    $0x1c3400,%eax
  10344c:	8b 00                	mov    (%eax),%eax
  10344e:	39 45 08             	cmp    %eax,0x8(%ebp)
  103451:	74 0f                	je     103462 <buddy_free_pages+0x5f>
  for(i=0;i<nr_block;i++)//找到块
  103453:	ff 45 e8             	incl   -0x18(%ebp)
  103456:	a1 c0 6f 12 00       	mov    0x126fc0,%eax
  10345b:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  10345e:	7c db                	jl     10343b <buddy_free_pages+0x38>
  103460:	eb 01                	jmp    103463 <buddy_free_pages+0x60>
     break;
  103462:	90                   	nop
  }
  int offset=rec[i].offset;
  103463:	8b 55 e8             	mov    -0x18(%ebp),%edx
  103466:	89 d0                	mov    %edx,%eax
  103468:	01 c0                	add    %eax,%eax
  10346a:	01 d0                	add    %edx,%eax
  10346c:	c1 e0 02             	shl    $0x2,%eax
  10346f:	05 04 34 1c 00       	add    $0x1c3404,%eax
  103474:	8b 00                	mov    (%eax),%eax
  103476:	89 45 dc             	mov    %eax,-0x24(%ebp)
  int pos=i;//暂存i
  103479:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10347c:	89 45 d8             	mov    %eax,-0x28(%ebp)
  i=0;
  10347f:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  while(i<offset)
  103486:	eb 12                	jmp    10349a <buddy_free_pages+0x97>
  103488:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10348b:	89 45 c4             	mov    %eax,-0x3c(%ebp)
  10348e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  103491:	8b 40 04             	mov    0x4(%eax),%eax
  {
    le=list_next(le);
  103494:	89 45 ec             	mov    %eax,-0x14(%ebp)
    i++;
  103497:	ff 45 e8             	incl   -0x18(%ebp)
  while(i<offset)
  10349a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10349d:	3b 45 dc             	cmp    -0x24(%ebp),%eax
  1034a0:	7c e6                	jl     103488 <buddy_free_pages+0x85>
  }
  int allocpages;
  if(!IS_POWER_OF_2(n))
  1034a2:	8b 45 0c             	mov    0xc(%ebp),%eax
  1034a5:	48                   	dec    %eax
  1034a6:	23 45 0c             	and    0xc(%ebp),%eax
  1034a9:	85 c0                	test   %eax,%eax
  1034ab:	74 10                	je     1034bd <buddy_free_pages+0xba>
   allocpages=fixsize(n);
  1034ad:	8b 45 0c             	mov    0xc(%ebp),%eax
  1034b0:	89 04 24             	mov    %eax,(%esp)
  1034b3:	e8 2a f8 ff ff       	call   102ce2 <fixsize>
  1034b8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1034bb:	eb 06                	jmp    1034c3 <buddy_free_pages+0xc0>
  else
  {
     allocpages=n;
  1034bd:	8b 45 0c             	mov    0xc(%ebp),%eax
  1034c0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  }
  assert(self && offset >= 0 && offset < self->size);//是否合法
  1034c3:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  1034c7:	74 12                	je     1034db <buddy_free_pages+0xd8>
  1034c9:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  1034cd:	78 0c                	js     1034db <buddy_free_pages+0xd8>
  1034cf:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1034d2:	8b 10                	mov    (%eax),%edx
  1034d4:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1034d7:	39 c2                	cmp    %eax,%edx
  1034d9:	77 24                	ja     1034ff <buddy_free_pages+0xfc>
  1034db:	c7 44 24 0c 90 9c 10 	movl   $0x109c90,0xc(%esp)
  1034e2:	00 
  1034e3:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  1034ea:	00 
  1034eb:	c7 44 24 04 ca 00 00 	movl   $0xca,0x4(%esp)
  1034f2:	00 
  1034f3:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  1034fa:	e8 22 cf ff ff       	call   100421 <__panic>
  node_size = 1;
  1034ff:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
  index = offset + self->size - 1;
  103506:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103509:	8b 10                	mov    (%eax),%edx
  10350b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10350e:	01 d0                	add    %edx,%eax
  103510:	48                   	dec    %eax
  103511:	89 45 f0             	mov    %eax,-0x10(%ebp)
  nr_free+=allocpages;//更新空闲页的数量
  103514:	8b 15 e8 33 1c 00    	mov    0x1c33e8,%edx
  10351a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10351d:	01 d0                	add    %edx,%eax
  10351f:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8
  struct Page* p;
  self[index].longest = allocpages;
  103524:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103527:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
  10352e:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103531:	01 c2                	add    %eax,%edx
  103533:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103536:	89 42 04             	mov    %eax,0x4(%edx)
  for(i=0;i<allocpages;i++)//回收已分配的页
  103539:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  103540:	eb 49                	jmp    10358b <buddy_free_pages+0x188>
  {
     p=le2page(le,page_link);
  103542:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103545:	83 e8 0c             	sub    $0xc,%eax
  103548:	89 45 cc             	mov    %eax,-0x34(%ebp)
     p->flags=0;
  10354b:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10354e:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     p->property=1;
  103555:	8b 45 cc             	mov    -0x34(%ebp),%eax
  103558:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
     SetPageProperty(p);
  10355f:	8b 45 cc             	mov    -0x34(%ebp),%eax
  103562:	83 c0 04             	add    $0x4,%eax
  103565:	c7 45 bc 01 00 00 00 	movl   $0x1,-0x44(%ebp)
  10356c:	89 45 b8             	mov    %eax,-0x48(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  10356f:	8b 45 b8             	mov    -0x48(%ebp),%eax
  103572:	8b 55 bc             	mov    -0x44(%ebp),%edx
  103575:	0f ab 10             	bts    %edx,(%eax)
}
  103578:	90                   	nop
  103579:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10357c:	89 45 c0             	mov    %eax,-0x40(%ebp)
  10357f:	8b 45 c0             	mov    -0x40(%ebp),%eax
  103582:	8b 40 04             	mov    0x4(%eax),%eax
     le=list_next(le);
  103585:	89 45 ec             	mov    %eax,-0x14(%ebp)
  for(i=0;i<allocpages;i++)//回收已分配的页
  103588:	ff 45 e8             	incl   -0x18(%ebp)
  10358b:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10358e:	3b 45 e4             	cmp    -0x1c(%ebp),%eax
  103591:	7c af                	jl     103542 <buddy_free_pages+0x13f>
  }
  //node_size=allocpages;
  while (index) {//向上合并，修改先祖节点的记录值
  103593:	eb 75                	jmp    10360a <buddy_free_pages+0x207>
    index = PARENT(index);
  103595:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103598:	40                   	inc    %eax
  103599:	d1 e8                	shr    %eax
  10359b:	48                   	dec    %eax
  10359c:	89 45 f0             	mov    %eax,-0x10(%ebp)
    node_size *= 2;
  10359f:	d1 65 f4             	shll   -0xc(%ebp)

    left_longest = self[LEFT_LEAF(index)].longest;
  1035a2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1035a5:	c1 e0 04             	shl    $0x4,%eax
  1035a8:	8d 50 08             	lea    0x8(%eax),%edx
  1035ab:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1035ae:	01 d0                	add    %edx,%eax
  1035b0:	8b 40 04             	mov    0x4(%eax),%eax
  1035b3:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    right_longest = self[RIGHT_LEAF(index)].longest;
  1035b6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1035b9:	40                   	inc    %eax
  1035ba:	c1 e0 04             	shl    $0x4,%eax
  1035bd:	89 c2                	mov    %eax,%edx
  1035bf:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1035c2:	01 d0                	add    %edx,%eax
  1035c4:	8b 40 04             	mov    0x4(%eax),%eax
  1035c7:	89 45 d0             	mov    %eax,-0x30(%ebp)
    
    if (left_longest + right_longest == node_size) 
  1035ca:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1035cd:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1035d0:	01 d0                	add    %edx,%eax
  1035d2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  1035d5:	75 17                	jne    1035ee <buddy_free_pages+0x1eb>
      self[index].longest = node_size;
  1035d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1035da:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
  1035e1:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1035e4:	01 c2                	add    %eax,%edx
  1035e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1035e9:	89 42 04             	mov    %eax,0x4(%edx)
  1035ec:	eb 1c                	jmp    10360a <buddy_free_pages+0x207>
    else
      self[index].longest = MAX(left_longest, right_longest);
  1035ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1035f1:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
  1035f8:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1035fb:	01 c2                	add    %eax,%edx
  1035fd:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  103600:	39 45 d0             	cmp    %eax,-0x30(%ebp)
  103603:	0f 43 45 d0          	cmovae -0x30(%ebp),%eax
  103607:	89 42 04             	mov    %eax,0x4(%edx)
  while (index) {//向上合并，修改先祖节点的记录值
  10360a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  10360e:	75 85                	jne    103595 <buddy_free_pages+0x192>
  }
  for(i=pos;i<nr_block-1;i++)//清除此次的分配记录
  103610:	8b 45 d8             	mov    -0x28(%ebp),%eax
  103613:	89 45 e8             	mov    %eax,-0x18(%ebp)
  103616:	eb 39                	jmp    103651 <buddy_free_pages+0x24e>
  {
    rec[i]=rec[i+1];
  103618:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10361b:	8d 48 01             	lea    0x1(%eax),%ecx
  10361e:	8b 55 e8             	mov    -0x18(%ebp),%edx
  103621:	89 d0                	mov    %edx,%eax
  103623:	01 c0                	add    %eax,%eax
  103625:	01 d0                	add    %edx,%eax
  103627:	c1 e0 02             	shl    $0x2,%eax
  10362a:	8d 90 00 34 1c 00    	lea    0x1c3400(%eax),%edx
  103630:	89 c8                	mov    %ecx,%eax
  103632:	01 c0                	add    %eax,%eax
  103634:	01 c8                	add    %ecx,%eax
  103636:	c1 e0 02             	shl    $0x2,%eax
  103639:	05 00 34 1c 00       	add    $0x1c3400,%eax
  10363e:	8b 08                	mov    (%eax),%ecx
  103640:	89 0a                	mov    %ecx,(%edx)
  103642:	8b 48 04             	mov    0x4(%eax),%ecx
  103645:	89 4a 04             	mov    %ecx,0x4(%edx)
  103648:	8b 40 08             	mov    0x8(%eax),%eax
  10364b:	89 42 08             	mov    %eax,0x8(%edx)
  for(i=pos;i<nr_block-1;i++)//清除此次的分配记录
  10364e:	ff 45 e8             	incl   -0x18(%ebp)
  103651:	a1 c0 6f 12 00       	mov    0x126fc0,%eax
  103656:	48                   	dec    %eax
  103657:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  10365a:	7c bc                	jl     103618 <buddy_free_pages+0x215>
  }
  nr_block--;//更新分配块数的值
  10365c:	a1 c0 6f 12 00       	mov    0x126fc0,%eax
  103661:	48                   	dec    %eax
  103662:	a3 c0 6f 12 00       	mov    %eax,0x126fc0
}
  103667:	90                   	nop
  103668:	c9                   	leave  
  103669:	c3                   	ret    

0010366a <buddy_nr_free_pages>:

static size_t
buddy_nr_free_pages(void) {
  10366a:	f3 0f 1e fb          	endbr32 
  10366e:	55                   	push   %ebp
  10366f:	89 e5                	mov    %esp,%ebp
    return nr_free;
  103671:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
}
  103676:	5d                   	pop    %ebp
  103677:	c3                   	ret    

00103678 <buddy_check>:

//以下是一个测试函数
static void

buddy_check(void) {
  103678:	f3 0f 1e fb          	endbr32 
  10367c:	55                   	push   %ebp
  10367d:	89 e5                	mov    %esp,%ebp
  10367f:	83 ec 38             	sub    $0x38,%esp
    struct Page *p0, *A, *B,*C,*D;
    p0 = A = B = C = D =NULL;
  103682:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  103689:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10368c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10368f:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103692:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103695:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103698:	89 45 e8             	mov    %eax,-0x18(%ebp)
  10369b:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10369e:	89 45 e4             	mov    %eax,-0x1c(%ebp)

    assert((p0 = alloc_page()) != NULL);
  1036a1:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1036a8:	e8 2a 07 00 00       	call   103dd7 <alloc_pages>
  1036ad:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1036b0:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  1036b4:	75 24                	jne    1036da <buddy_check+0x62>
  1036b6:	c7 44 24 0c bb 9c 10 	movl   $0x109cbb,0xc(%esp)
  1036bd:	00 
  1036be:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  1036c5:	00 
  1036c6:	c7 44 24 04 f8 00 00 	movl   $0xf8,0x4(%esp)
  1036cd:	00 
  1036ce:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  1036d5:	e8 47 cd ff ff       	call   100421 <__panic>
    assert((A = alloc_page()) != NULL);
  1036da:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1036e1:	e8 f1 06 00 00       	call   103dd7 <alloc_pages>
  1036e6:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1036e9:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  1036ed:	75 24                	jne    103713 <buddy_check+0x9b>
  1036ef:	c7 44 24 0c d7 9c 10 	movl   $0x109cd7,0xc(%esp)
  1036f6:	00 
  1036f7:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  1036fe:	00 
  1036ff:	c7 44 24 04 f9 00 00 	movl   $0xf9,0x4(%esp)
  103706:	00 
  103707:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  10370e:	e8 0e cd ff ff       	call   100421 <__panic>
    assert((B = alloc_page()) != NULL);
  103713:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10371a:	e8 b8 06 00 00       	call   103dd7 <alloc_pages>
  10371f:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103722:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  103726:	75 24                	jne    10374c <buddy_check+0xd4>
  103728:	c7 44 24 0c f2 9c 10 	movl   $0x109cf2,0xc(%esp)
  10372f:	00 
  103730:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  103737:	00 
  103738:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
  10373f:	00 
  103740:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  103747:	e8 d5 cc ff ff       	call   100421 <__panic>

    assert(p0 != A && p0 != B && A != B);
  10374c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10374f:	3b 45 e8             	cmp    -0x18(%ebp),%eax
  103752:	74 10                	je     103764 <buddy_check+0xec>
  103754:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103757:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  10375a:	74 08                	je     103764 <buddy_check+0xec>
  10375c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10375f:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  103762:	75 24                	jne    103788 <buddy_check+0x110>
  103764:	c7 44 24 0c 0d 9d 10 	movl   $0x109d0d,0xc(%esp)
  10376b:	00 
  10376c:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  103773:	00 
  103774:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
  10377b:	00 
  10377c:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  103783:	e8 99 cc ff ff       	call   100421 <__panic>
    assert(page_ref(p0) == 0 && page_ref(A) == 0 && page_ref(B) == 0);
  103788:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10378b:	89 04 24             	mov    %eax,(%esp)
  10378e:	e8 37 f5 ff ff       	call   102cca <page_ref>
  103793:	85 c0                	test   %eax,%eax
  103795:	75 1e                	jne    1037b5 <buddy_check+0x13d>
  103797:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10379a:	89 04 24             	mov    %eax,(%esp)
  10379d:	e8 28 f5 ff ff       	call   102cca <page_ref>
  1037a2:	85 c0                	test   %eax,%eax
  1037a4:	75 0f                	jne    1037b5 <buddy_check+0x13d>
  1037a6:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1037a9:	89 04 24             	mov    %eax,(%esp)
  1037ac:	e8 19 f5 ff ff       	call   102cca <page_ref>
  1037b1:	85 c0                	test   %eax,%eax
  1037b3:	74 24                	je     1037d9 <buddy_check+0x161>
  1037b5:	c7 44 24 0c 2c 9d 10 	movl   $0x109d2c,0xc(%esp)
  1037bc:	00 
  1037bd:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  1037c4:	00 
  1037c5:	c7 44 24 04 fd 00 00 	movl   $0xfd,0x4(%esp)
  1037cc:	00 
  1037cd:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  1037d4:	e8 48 cc ff ff       	call   100421 <__panic>
    free_page(p0);
  1037d9:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1037e0:	00 
  1037e1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1037e4:	89 04 24             	mov    %eax,(%esp)
  1037e7:	e8 27 06 00 00       	call   103e13 <free_pages>
    free_page(A);
  1037ec:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1037f3:	00 
  1037f4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1037f7:	89 04 24             	mov    %eax,(%esp)
  1037fa:	e8 14 06 00 00       	call   103e13 <free_pages>
    free_page(B);
  1037ff:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103806:	00 
  103807:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10380a:	89 04 24             	mov    %eax,(%esp)
  10380d:	e8 01 06 00 00       	call   103e13 <free_pages>
    
    A=alloc_pages(500);
  103812:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
  103819:	e8 b9 05 00 00       	call   103dd7 <alloc_pages>
  10381e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    B=alloc_pages(500);
  103821:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
  103828:	e8 aa 05 00 00       	call   103dd7 <alloc_pages>
  10382d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    cprintf("A %p\n",A);
  103830:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103833:	89 44 24 04          	mov    %eax,0x4(%esp)
  103837:	c7 04 24 66 9d 10 00 	movl   $0x109d66,(%esp)
  10383e:	e8 72 ca ff ff       	call   1002b5 <cprintf>
    cprintf("B %p\n",B);
  103843:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103846:	89 44 24 04          	mov    %eax,0x4(%esp)
  10384a:	c7 04 24 6c 9d 10 00 	movl   $0x109d6c,(%esp)
  103851:	e8 5f ca ff ff       	call   1002b5 <cprintf>
    free_pages(A,250);
  103856:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
  10385d:	00 
  10385e:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103861:	89 04 24             	mov    %eax,(%esp)
  103864:	e8 aa 05 00 00       	call   103e13 <free_pages>
    free_pages(B,500);
  103869:	c7 44 24 04 f4 01 00 	movl   $0x1f4,0x4(%esp)
  103870:	00 
  103871:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103874:	89 04 24             	mov    %eax,(%esp)
  103877:	e8 97 05 00 00       	call   103e13 <free_pages>
    free_pages(A+250,250);
  10387c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10387f:	05 28 23 00 00       	add    $0x2328,%eax
  103884:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
  10388b:	00 
  10388c:	89 04 24             	mov    %eax,(%esp)
  10388f:	e8 7f 05 00 00       	call   103e13 <free_pages>
    
    p0=alloc_pages(1024);
  103894:	c7 04 24 00 04 00 00 	movl   $0x400,(%esp)
  10389b:	e8 37 05 00 00       	call   103dd7 <alloc_pages>
  1038a0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    cprintf("p0 %p\n",p0);
  1038a3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1038a6:	89 44 24 04          	mov    %eax,0x4(%esp)
  1038aa:	c7 04 24 72 9d 10 00 	movl   $0x109d72,(%esp)
  1038b1:	e8 ff c9 ff ff       	call   1002b5 <cprintf>
    assert(p0 == A);
  1038b6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1038b9:	3b 45 e8             	cmp    -0x18(%ebp),%eax
  1038bc:	74 24                	je     1038e2 <buddy_check+0x26a>
  1038be:	c7 44 24 0c 79 9d 10 	movl   $0x109d79,0xc(%esp)
  1038c5:	00 
  1038c6:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  1038cd:	00 
  1038ce:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
  1038d5:	00 
  1038d6:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  1038dd:	e8 3f cb ff ff       	call   100421 <__panic>
    //以下是根据链接中的样例测试编写的
    A=alloc_pages(70);  
  1038e2:	c7 04 24 46 00 00 00 	movl   $0x46,(%esp)
  1038e9:	e8 e9 04 00 00       	call   103dd7 <alloc_pages>
  1038ee:	89 45 e8             	mov    %eax,-0x18(%ebp)
    B=alloc_pages(35);
  1038f1:	c7 04 24 23 00 00 00 	movl   $0x23,(%esp)
  1038f8:	e8 da 04 00 00       	call   103dd7 <alloc_pages>
  1038fd:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(A+128==B);//检查是否相邻
  103900:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103903:	05 00 12 00 00       	add    $0x1200,%eax
  103908:	39 45 ec             	cmp    %eax,-0x14(%ebp)
  10390b:	74 24                	je     103931 <buddy_check+0x2b9>
  10390d:	c7 44 24 0c 81 9d 10 	movl   $0x109d81,0xc(%esp)
  103914:	00 
  103915:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  10391c:	00 
  10391d:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
  103924:	00 
  103925:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  10392c:	e8 f0 ca ff ff       	call   100421 <__panic>
    cprintf("A %p\n",A);
  103931:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103934:	89 44 24 04          	mov    %eax,0x4(%esp)
  103938:	c7 04 24 66 9d 10 00 	movl   $0x109d66,(%esp)
  10393f:	e8 71 c9 ff ff       	call   1002b5 <cprintf>
    cprintf("B %p\n",B);
  103944:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103947:	89 44 24 04          	mov    %eax,0x4(%esp)
  10394b:	c7 04 24 6c 9d 10 00 	movl   $0x109d6c,(%esp)
  103952:	e8 5e c9 ff ff       	call   1002b5 <cprintf>
    C=alloc_pages(80);
  103957:	c7 04 24 50 00 00 00 	movl   $0x50,(%esp)
  10395e:	e8 74 04 00 00       	call   103dd7 <alloc_pages>
  103963:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(A+256==C);//检查C有没有和A重叠
  103966:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103969:	05 00 24 00 00       	add    $0x2400,%eax
  10396e:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  103971:	74 24                	je     103997 <buddy_check+0x31f>
  103973:	c7 44 24 0c 8a 9d 10 	movl   $0x109d8a,0xc(%esp)
  10397a:	00 
  10397b:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  103982:	00 
  103983:	c7 44 24 04 14 01 00 	movl   $0x114,0x4(%esp)
  10398a:	00 
  10398b:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  103992:	e8 8a ca ff ff       	call   100421 <__panic>
    cprintf("C %p\n",C);
  103997:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10399a:	89 44 24 04          	mov    %eax,0x4(%esp)
  10399e:	c7 04 24 93 9d 10 00 	movl   $0x109d93,(%esp)
  1039a5:	e8 0b c9 ff ff       	call   1002b5 <cprintf>
    free_pages(A,70);//释放A
  1039aa:	c7 44 24 04 46 00 00 	movl   $0x46,0x4(%esp)
  1039b1:	00 
  1039b2:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1039b5:	89 04 24             	mov    %eax,(%esp)
  1039b8:	e8 56 04 00 00       	call   103e13 <free_pages>
    cprintf("B %p\n",B);
  1039bd:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1039c0:	89 44 24 04          	mov    %eax,0x4(%esp)
  1039c4:	c7 04 24 6c 9d 10 00 	movl   $0x109d6c,(%esp)
  1039cb:	e8 e5 c8 ff ff       	call   1002b5 <cprintf>
    D=alloc_pages(60);
  1039d0:	c7 04 24 3c 00 00 00 	movl   $0x3c,(%esp)
  1039d7:	e8 fb 03 00 00       	call   103dd7 <alloc_pages>
  1039dc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("D %p\n",D);
  1039df:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1039e2:	89 44 24 04          	mov    %eax,0x4(%esp)
  1039e6:	c7 04 24 99 9d 10 00 	movl   $0x109d99,(%esp)
  1039ed:	e8 c3 c8 ff ff       	call   1002b5 <cprintf>
    assert(B+64==D);//检查B，D是否相邻
  1039f2:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1039f5:	05 00 09 00 00       	add    $0x900,%eax
  1039fa:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  1039fd:	74 24                	je     103a23 <buddy_check+0x3ab>
  1039ff:	c7 44 24 0c 9f 9d 10 	movl   $0x109d9f,0xc(%esp)
  103a06:	00 
  103a07:	c7 44 24 08 54 9c 10 	movl   $0x109c54,0x8(%esp)
  103a0e:	00 
  103a0f:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
  103a16:	00 
  103a17:	c7 04 24 69 9c 10 00 	movl   $0x109c69,(%esp)
  103a1e:	e8 fe c9 ff ff       	call   100421 <__panic>
    free_pages(B,35);
  103a23:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  103a2a:	00 
  103a2b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103a2e:	89 04 24             	mov    %eax,(%esp)
  103a31:	e8 dd 03 00 00       	call   103e13 <free_pages>
    cprintf("D %p\n",D);
  103a36:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103a39:	89 44 24 04          	mov    %eax,0x4(%esp)
  103a3d:	c7 04 24 99 9d 10 00 	movl   $0x109d99,(%esp)
  103a44:	e8 6c c8 ff ff       	call   1002b5 <cprintf>
    free_pages(D,60);
  103a49:	c7 44 24 04 3c 00 00 	movl   $0x3c,0x4(%esp)
  103a50:	00 
  103a51:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103a54:	89 04 24             	mov    %eax,(%esp)
  103a57:	e8 b7 03 00 00       	call   103e13 <free_pages>
    cprintf("C %p\n",C);
  103a5c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103a5f:	89 44 24 04          	mov    %eax,0x4(%esp)
  103a63:	c7 04 24 93 9d 10 00 	movl   $0x109d93,(%esp)
  103a6a:	e8 46 c8 ff ff       	call   1002b5 <cprintf>
    free_pages(C,80);
  103a6f:	c7 44 24 04 50 00 00 	movl   $0x50,0x4(%esp)
  103a76:	00 
  103a77:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103a7a:	89 04 24             	mov    %eax,(%esp)
  103a7d:	e8 91 03 00 00       	call   103e13 <free_pages>
    free_pages(p0,1000);//全部释放
  103a82:	c7 44 24 04 e8 03 00 	movl   $0x3e8,0x4(%esp)
  103a89:	00 
  103a8a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103a8d:	89 04 24             	mov    %eax,(%esp)
  103a90:	e8 7e 03 00 00       	call   103e13 <free_pages>
}
  103a95:	90                   	nop
  103a96:	c9                   	leave  
  103a97:	c3                   	ret    

00103a98 <page2ppn>:
page2ppn(struct Page *page) {
  103a98:	55                   	push   %ebp
  103a99:	89 e5                	mov    %esp,%ebp
    return page - pages;
  103a9b:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  103aa0:	8b 55 08             	mov    0x8(%ebp),%edx
  103aa3:	29 c2                	sub    %eax,%edx
  103aa5:	89 d0                	mov    %edx,%eax
  103aa7:	c1 f8 02             	sar    $0x2,%eax
  103aaa:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
  103ab0:	5d                   	pop    %ebp
  103ab1:	c3                   	ret    

00103ab2 <page2pa>:
page2pa(struct Page *page) {
  103ab2:	55                   	push   %ebp
  103ab3:	89 e5                	mov    %esp,%ebp
  103ab5:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  103ab8:	8b 45 08             	mov    0x8(%ebp),%eax
  103abb:	89 04 24             	mov    %eax,(%esp)
  103abe:	e8 d5 ff ff ff       	call   103a98 <page2ppn>
  103ac3:	c1 e0 0c             	shl    $0xc,%eax
}
  103ac6:	c9                   	leave  
  103ac7:	c3                   	ret    

00103ac8 <pa2page>:
pa2page(uintptr_t pa) {
  103ac8:	55                   	push   %ebp
  103ac9:	89 e5                	mov    %esp,%ebp
  103acb:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
  103ace:	8b 45 08             	mov    0x8(%ebp),%eax
  103ad1:	c1 e8 0c             	shr    $0xc,%eax
  103ad4:	89 c2                	mov    %eax,%edx
  103ad6:	a1 80 6e 12 00       	mov    0x126e80,%eax
  103adb:	39 c2                	cmp    %eax,%edx
  103add:	72 1c                	jb     103afb <pa2page+0x33>
        panic("pa2page called with invalid pa");
  103adf:	c7 44 24 08 d8 9d 10 	movl   $0x109dd8,0x8(%esp)
  103ae6:	00 
  103ae7:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
  103aee:	00 
  103aef:	c7 04 24 f7 9d 10 00 	movl   $0x109df7,(%esp)
  103af6:	e8 26 c9 ff ff       	call   100421 <__panic>
    return &pages[PPN(pa)];
  103afb:	8b 0d 08 da 2a 00    	mov    0x2ada08,%ecx
  103b01:	8b 45 08             	mov    0x8(%ebp),%eax
  103b04:	c1 e8 0c             	shr    $0xc,%eax
  103b07:	89 c2                	mov    %eax,%edx
  103b09:	89 d0                	mov    %edx,%eax
  103b0b:	c1 e0 03             	shl    $0x3,%eax
  103b0e:	01 d0                	add    %edx,%eax
  103b10:	c1 e0 02             	shl    $0x2,%eax
  103b13:	01 c8                	add    %ecx,%eax
}
  103b15:	c9                   	leave  
  103b16:	c3                   	ret    

00103b17 <page2kva>:
page2kva(struct Page *page) {
  103b17:	55                   	push   %ebp
  103b18:	89 e5                	mov    %esp,%ebp
  103b1a:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
  103b1d:	8b 45 08             	mov    0x8(%ebp),%eax
  103b20:	89 04 24             	mov    %eax,(%esp)
  103b23:	e8 8a ff ff ff       	call   103ab2 <page2pa>
  103b28:	89 45 f4             	mov    %eax,-0xc(%ebp)
  103b2b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103b2e:	c1 e8 0c             	shr    $0xc,%eax
  103b31:	89 45 f0             	mov    %eax,-0x10(%ebp)
  103b34:	a1 80 6e 12 00       	mov    0x126e80,%eax
  103b39:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  103b3c:	72 23                	jb     103b61 <page2kva+0x4a>
  103b3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103b41:	89 44 24 0c          	mov    %eax,0xc(%esp)
  103b45:	c7 44 24 08 08 9e 10 	movl   $0x109e08,0x8(%esp)
  103b4c:	00 
  103b4d:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
  103b54:	00 
  103b55:	c7 04 24 f7 9d 10 00 	movl   $0x109df7,(%esp)
  103b5c:	e8 c0 c8 ff ff       	call   100421 <__panic>
  103b61:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103b64:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
  103b69:	c9                   	leave  
  103b6a:	c3                   	ret    

00103b6b <pte2page>:
pte2page(pte_t pte) {
  103b6b:	55                   	push   %ebp
  103b6c:	89 e5                	mov    %esp,%ebp
  103b6e:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
  103b71:	8b 45 08             	mov    0x8(%ebp),%eax
  103b74:	83 e0 01             	and    $0x1,%eax
  103b77:	85 c0                	test   %eax,%eax
  103b79:	75 1c                	jne    103b97 <pte2page+0x2c>
        panic("pte2page called with invalid pte");
  103b7b:	c7 44 24 08 2c 9e 10 	movl   $0x109e2c,0x8(%esp)
  103b82:	00 
  103b83:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
  103b8a:	00 
  103b8b:	c7 04 24 f7 9d 10 00 	movl   $0x109df7,(%esp)
  103b92:	e8 8a c8 ff ff       	call   100421 <__panic>
    return pa2page(PTE_ADDR(pte));
  103b97:	8b 45 08             	mov    0x8(%ebp),%eax
  103b9a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  103b9f:	89 04 24             	mov    %eax,(%esp)
  103ba2:	e8 21 ff ff ff       	call   103ac8 <pa2page>
}
  103ba7:	c9                   	leave  
  103ba8:	c3                   	ret    

00103ba9 <pde2page>:
pde2page(pde_t pde) {
  103ba9:	55                   	push   %ebp
  103baa:	89 e5                	mov    %esp,%ebp
  103bac:	83 ec 18             	sub    $0x18,%esp
    return pa2page(PDE_ADDR(pde));
  103baf:	8b 45 08             	mov    0x8(%ebp),%eax
  103bb2:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  103bb7:	89 04 24             	mov    %eax,(%esp)
  103bba:	e8 09 ff ff ff       	call   103ac8 <pa2page>
}
  103bbf:	c9                   	leave  
  103bc0:	c3                   	ret    

00103bc1 <page_ref>:
page_ref(struct Page *page) {
  103bc1:	55                   	push   %ebp
  103bc2:	89 e5                	mov    %esp,%ebp
    return page->ref;
  103bc4:	8b 45 08             	mov    0x8(%ebp),%eax
  103bc7:	8b 00                	mov    (%eax),%eax
}
  103bc9:	5d                   	pop    %ebp
  103bca:	c3                   	ret    

00103bcb <set_page_ref>:
set_page_ref(struct Page *page, int val) {
  103bcb:	55                   	push   %ebp
  103bcc:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  103bce:	8b 45 08             	mov    0x8(%ebp),%eax
  103bd1:	8b 55 0c             	mov    0xc(%ebp),%edx
  103bd4:	89 10                	mov    %edx,(%eax)
}
  103bd6:	90                   	nop
  103bd7:	5d                   	pop    %ebp
  103bd8:	c3                   	ret    

00103bd9 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
  103bd9:	55                   	push   %ebp
  103bda:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
  103bdc:	8b 45 08             	mov    0x8(%ebp),%eax
  103bdf:	8b 00                	mov    (%eax),%eax
  103be1:	8d 50 01             	lea    0x1(%eax),%edx
  103be4:	8b 45 08             	mov    0x8(%ebp),%eax
  103be7:	89 10                	mov    %edx,(%eax)
    return page->ref;
  103be9:	8b 45 08             	mov    0x8(%ebp),%eax
  103bec:	8b 00                	mov    (%eax),%eax
}
  103bee:	5d                   	pop    %ebp
  103bef:	c3                   	ret    

00103bf0 <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
  103bf0:	55                   	push   %ebp
  103bf1:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
  103bf3:	8b 45 08             	mov    0x8(%ebp),%eax
  103bf6:	8b 00                	mov    (%eax),%eax
  103bf8:	8d 50 ff             	lea    -0x1(%eax),%edx
  103bfb:	8b 45 08             	mov    0x8(%ebp),%eax
  103bfe:	89 10                	mov    %edx,(%eax)
    return page->ref;
  103c00:	8b 45 08             	mov    0x8(%ebp),%eax
  103c03:	8b 00                	mov    (%eax),%eax
}
  103c05:	5d                   	pop    %ebp
  103c06:	c3                   	ret    

00103c07 <__intr_save>:
__intr_save(void) {
  103c07:	55                   	push   %ebp
  103c08:	89 e5                	mov    %esp,%ebp
  103c0a:	83 ec 18             	sub    $0x18,%esp
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
  103c0d:	9c                   	pushf  
  103c0e:	58                   	pop    %eax
  103c0f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
  103c12:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
  103c15:	25 00 02 00 00       	and    $0x200,%eax
  103c1a:	85 c0                	test   %eax,%eax
  103c1c:	74 0c                	je     103c2a <__intr_save+0x23>
        intr_disable();
  103c1e:	e8 6d dd ff ff       	call   101990 <intr_disable>
        return 1;
  103c23:	b8 01 00 00 00       	mov    $0x1,%eax
  103c28:	eb 05                	jmp    103c2f <__intr_save+0x28>
    return 0;
  103c2a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  103c2f:	c9                   	leave  
  103c30:	c3                   	ret    

00103c31 <__intr_restore>:
__intr_restore(bool flag) {
  103c31:	55                   	push   %ebp
  103c32:	89 e5                	mov    %esp,%ebp
  103c34:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
  103c37:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  103c3b:	74 05                	je     103c42 <__intr_restore+0x11>
        intr_enable();
  103c3d:	e8 42 dd ff ff       	call   101984 <intr_enable>
}
  103c42:	90                   	nop
  103c43:	c9                   	leave  
  103c44:	c3                   	ret    

00103c45 <lgdt>:
/* *
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
  103c45:	55                   	push   %ebp
  103c46:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));
  103c48:	8b 45 08             	mov    0x8(%ebp),%eax
  103c4b:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
  103c4e:	b8 23 00 00 00       	mov    $0x23,%eax
  103c53:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
  103c55:	b8 23 00 00 00       	mov    $0x23,%eax
  103c5a:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
  103c5c:	b8 10 00 00 00       	mov    $0x10,%eax
  103c61:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
  103c63:	b8 10 00 00 00       	mov    $0x10,%eax
  103c68:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
  103c6a:	b8 10 00 00 00       	mov    $0x10,%eax
  103c6f:	8e d0                	mov    %eax,%ss
    // reload cs
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
  103c71:	ea 78 3c 10 00 08 00 	ljmp   $0x8,$0x103c78
}
  103c78:	90                   	nop
  103c79:	5d                   	pop    %ebp
  103c7a:	c3                   	ret    

00103c7b <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
  103c7b:	f3 0f 1e fb          	endbr32 
  103c7f:	55                   	push   %ebp
  103c80:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
  103c82:	8b 45 08             	mov    0x8(%ebp),%eax
  103c85:	a3 a4 6e 12 00       	mov    %eax,0x126ea4
}
  103c8a:	90                   	nop
  103c8b:	5d                   	pop    %ebp
  103c8c:	c3                   	ret    

00103c8d <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
  103c8d:	f3 0f 1e fb          	endbr32 
  103c91:	55                   	push   %ebp
  103c92:	89 e5                	mov    %esp,%ebp
  103c94:	83 ec 14             	sub    $0x14,%esp
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
  103c97:	b8 00 30 12 00       	mov    $0x123000,%eax
  103c9c:	89 04 24             	mov    %eax,(%esp)
  103c9f:	e8 d7 ff ff ff       	call   103c7b <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
  103ca4:	66 c7 05 a8 6e 12 00 	movw   $0x10,0x126ea8
  103cab:	10 00 

    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
  103cad:	66 c7 05 28 3a 12 00 	movw   $0x68,0x123a28
  103cb4:	68 00 
  103cb6:	b8 a0 6e 12 00       	mov    $0x126ea0,%eax
  103cbb:	0f b7 c0             	movzwl %ax,%eax
  103cbe:	66 a3 2a 3a 12 00    	mov    %ax,0x123a2a
  103cc4:	b8 a0 6e 12 00       	mov    $0x126ea0,%eax
  103cc9:	c1 e8 10             	shr    $0x10,%eax
  103ccc:	a2 2c 3a 12 00       	mov    %al,0x123a2c
  103cd1:	0f b6 05 2d 3a 12 00 	movzbl 0x123a2d,%eax
  103cd8:	24 f0                	and    $0xf0,%al
  103cda:	0c 09                	or     $0x9,%al
  103cdc:	a2 2d 3a 12 00       	mov    %al,0x123a2d
  103ce1:	0f b6 05 2d 3a 12 00 	movzbl 0x123a2d,%eax
  103ce8:	24 ef                	and    $0xef,%al
  103cea:	a2 2d 3a 12 00       	mov    %al,0x123a2d
  103cef:	0f b6 05 2d 3a 12 00 	movzbl 0x123a2d,%eax
  103cf6:	24 9f                	and    $0x9f,%al
  103cf8:	a2 2d 3a 12 00       	mov    %al,0x123a2d
  103cfd:	0f b6 05 2d 3a 12 00 	movzbl 0x123a2d,%eax
  103d04:	0c 80                	or     $0x80,%al
  103d06:	a2 2d 3a 12 00       	mov    %al,0x123a2d
  103d0b:	0f b6 05 2e 3a 12 00 	movzbl 0x123a2e,%eax
  103d12:	24 f0                	and    $0xf0,%al
  103d14:	a2 2e 3a 12 00       	mov    %al,0x123a2e
  103d19:	0f b6 05 2e 3a 12 00 	movzbl 0x123a2e,%eax
  103d20:	24 ef                	and    $0xef,%al
  103d22:	a2 2e 3a 12 00       	mov    %al,0x123a2e
  103d27:	0f b6 05 2e 3a 12 00 	movzbl 0x123a2e,%eax
  103d2e:	24 df                	and    $0xdf,%al
  103d30:	a2 2e 3a 12 00       	mov    %al,0x123a2e
  103d35:	0f b6 05 2e 3a 12 00 	movzbl 0x123a2e,%eax
  103d3c:	0c 40                	or     $0x40,%al
  103d3e:	a2 2e 3a 12 00       	mov    %al,0x123a2e
  103d43:	0f b6 05 2e 3a 12 00 	movzbl 0x123a2e,%eax
  103d4a:	24 7f                	and    $0x7f,%al
  103d4c:	a2 2e 3a 12 00       	mov    %al,0x123a2e
  103d51:	b8 a0 6e 12 00       	mov    $0x126ea0,%eax
  103d56:	c1 e8 18             	shr    $0x18,%eax
  103d59:	a2 2f 3a 12 00       	mov    %al,0x123a2f

    // reload all segment registers
    lgdt(&gdt_pd);
  103d5e:	c7 04 24 30 3a 12 00 	movl   $0x123a30,(%esp)
  103d65:	e8 db fe ff ff       	call   103c45 <lgdt>
  103d6a:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
  103d70:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
  103d74:	0f 00 d8             	ltr    %ax
}
  103d77:	90                   	nop

    // load the TSS
    ltr(GD_TSS);
}
  103d78:	90                   	nop
  103d79:	c9                   	leave  
  103d7a:	c3                   	ret    

00103d7b <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
static void
init_pmm_manager(void) {
  103d7b:	f3 0f 1e fb          	endbr32 
  103d7f:	55                   	push   %ebp
  103d80:	89 e5                	mov    %esp,%ebp
  103d82:	83 ec 18             	sub    $0x18,%esp
    pmm_manager = &buddy_pmm_manager;
  103d85:	c7 05 00 da 2a 00 a0 	movl   $0x10afa0,0x2ada00
  103d8c:	af 10 00 
    cprintf("memory management: %s\n", pmm_manager->name);
  103d8f:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  103d94:	8b 00                	mov    (%eax),%eax
  103d96:	89 44 24 04          	mov    %eax,0x4(%esp)
  103d9a:	c7 04 24 58 9e 10 00 	movl   $0x109e58,(%esp)
  103da1:	e8 0f c5 ff ff       	call   1002b5 <cprintf>
    pmm_manager->init();
  103da6:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  103dab:	8b 40 04             	mov    0x4(%eax),%eax
  103dae:	ff d0                	call   *%eax
}
  103db0:	90                   	nop
  103db1:	c9                   	leave  
  103db2:	c3                   	ret    

00103db3 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
static void
init_memmap(struct Page *base, size_t n) {
  103db3:	f3 0f 1e fb          	endbr32 
  103db7:	55                   	push   %ebp
  103db8:	89 e5                	mov    %esp,%ebp
  103dba:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
  103dbd:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  103dc2:	8b 40 08             	mov    0x8(%eax),%eax
  103dc5:	8b 55 0c             	mov    0xc(%ebp),%edx
  103dc8:	89 54 24 04          	mov    %edx,0x4(%esp)
  103dcc:	8b 55 08             	mov    0x8(%ebp),%edx
  103dcf:	89 14 24             	mov    %edx,(%esp)
  103dd2:	ff d0                	call   *%eax
}
  103dd4:	90                   	nop
  103dd5:	c9                   	leave  
  103dd6:	c3                   	ret    

00103dd7 <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
struct Page *
alloc_pages(size_t n) {
  103dd7:	f3 0f 1e fb          	endbr32 
  103ddb:	55                   	push   %ebp
  103ddc:	89 e5                	mov    %esp,%ebp
  103dde:	83 ec 28             	sub    $0x28,%esp
    struct Page *page=NULL;
  103de1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
  103de8:	e8 1a fe ff ff       	call   103c07 <__intr_save>
  103ded:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        page = pmm_manager->alloc_pages(n);
  103df0:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  103df5:	8b 40 0c             	mov    0xc(%eax),%eax
  103df8:	8b 55 08             	mov    0x8(%ebp),%edx
  103dfb:	89 14 24             	mov    %edx,(%esp)
  103dfe:	ff d0                	call   *%eax
  103e00:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    local_intr_restore(intr_flag);
  103e03:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103e06:	89 04 24             	mov    %eax,(%esp)
  103e09:	e8 23 fe ff ff       	call   103c31 <__intr_restore>
    return page;
  103e0e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  103e11:	c9                   	leave  
  103e12:	c3                   	ret    

00103e13 <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
void
free_pages(struct Page *base, size_t n) {
  103e13:	f3 0f 1e fb          	endbr32 
  103e17:	55                   	push   %ebp
  103e18:	89 e5                	mov    %esp,%ebp
  103e1a:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
  103e1d:	e8 e5 fd ff ff       	call   103c07 <__intr_save>
  103e22:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        pmm_manager->free_pages(base, n);
  103e25:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  103e2a:	8b 40 10             	mov    0x10(%eax),%eax
  103e2d:	8b 55 0c             	mov    0xc(%ebp),%edx
  103e30:	89 54 24 04          	mov    %edx,0x4(%esp)
  103e34:	8b 55 08             	mov    0x8(%ebp),%edx
  103e37:	89 14 24             	mov    %edx,(%esp)
  103e3a:	ff d0                	call   *%eax
    }
    local_intr_restore(intr_flag);
  103e3c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103e3f:	89 04 24             	mov    %eax,(%esp)
  103e42:	e8 ea fd ff ff       	call   103c31 <__intr_restore>
}
  103e47:	90                   	nop
  103e48:	c9                   	leave  
  103e49:	c3                   	ret    

00103e4a <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
size_t
nr_free_pages(void) {
  103e4a:	f3 0f 1e fb          	endbr32 
  103e4e:	55                   	push   %ebp
  103e4f:	89 e5                	mov    %esp,%ebp
  103e51:	83 ec 28             	sub    $0x28,%esp
    size_t ret;
    bool intr_flag;
    local_intr_save(intr_flag);
  103e54:	e8 ae fd ff ff       	call   103c07 <__intr_save>
  103e59:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();
  103e5c:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  103e61:	8b 40 14             	mov    0x14(%eax),%eax
  103e64:	ff d0                	call   *%eax
  103e66:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
  103e69:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103e6c:	89 04 24             	mov    %eax,(%esp)
  103e6f:	e8 bd fd ff ff       	call   103c31 <__intr_restore>
    return ret;
  103e74:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  103e77:	c9                   	leave  
  103e78:	c3                   	ret    

00103e79 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
  103e79:	f3 0f 1e fb          	endbr32 
  103e7d:	55                   	push   %ebp
  103e7e:	89 e5                	mov    %esp,%ebp
  103e80:	57                   	push   %edi
  103e81:	56                   	push   %esi
  103e82:	53                   	push   %ebx
  103e83:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
  103e89:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;
  103e90:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  103e97:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");
  103e9e:	c7 04 24 6f 9e 10 00 	movl   $0x109e6f,(%esp)
  103ea5:	e8 0b c4 ff ff       	call   1002b5 <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
  103eaa:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  103eb1:	e9 1a 01 00 00       	jmp    103fd0 <page_init+0x157>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
  103eb6:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103eb9:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103ebc:	89 d0                	mov    %edx,%eax
  103ebe:	c1 e0 02             	shl    $0x2,%eax
  103ec1:	01 d0                	add    %edx,%eax
  103ec3:	c1 e0 02             	shl    $0x2,%eax
  103ec6:	01 c8                	add    %ecx,%eax
  103ec8:	8b 50 08             	mov    0x8(%eax),%edx
  103ecb:	8b 40 04             	mov    0x4(%eax),%eax
  103ece:	89 45 a0             	mov    %eax,-0x60(%ebp)
  103ed1:	89 55 a4             	mov    %edx,-0x5c(%ebp)
  103ed4:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103ed7:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103eda:	89 d0                	mov    %edx,%eax
  103edc:	c1 e0 02             	shl    $0x2,%eax
  103edf:	01 d0                	add    %edx,%eax
  103ee1:	c1 e0 02             	shl    $0x2,%eax
  103ee4:	01 c8                	add    %ecx,%eax
  103ee6:	8b 48 0c             	mov    0xc(%eax),%ecx
  103ee9:	8b 58 10             	mov    0x10(%eax),%ebx
  103eec:	8b 45 a0             	mov    -0x60(%ebp),%eax
  103eef:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  103ef2:	01 c8                	add    %ecx,%eax
  103ef4:	11 da                	adc    %ebx,%edx
  103ef6:	89 45 98             	mov    %eax,-0x68(%ebp)
  103ef9:	89 55 9c             	mov    %edx,-0x64(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
  103efc:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103eff:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103f02:	89 d0                	mov    %edx,%eax
  103f04:	c1 e0 02             	shl    $0x2,%eax
  103f07:	01 d0                	add    %edx,%eax
  103f09:	c1 e0 02             	shl    $0x2,%eax
  103f0c:	01 c8                	add    %ecx,%eax
  103f0e:	83 c0 14             	add    $0x14,%eax
  103f11:	8b 00                	mov    (%eax),%eax
  103f13:	89 45 84             	mov    %eax,-0x7c(%ebp)
  103f16:	8b 45 98             	mov    -0x68(%ebp),%eax
  103f19:	8b 55 9c             	mov    -0x64(%ebp),%edx
  103f1c:	83 c0 ff             	add    $0xffffffff,%eax
  103f1f:	83 d2 ff             	adc    $0xffffffff,%edx
  103f22:	89 85 78 ff ff ff    	mov    %eax,-0x88(%ebp)
  103f28:	89 95 7c ff ff ff    	mov    %edx,-0x84(%ebp)
  103f2e:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103f31:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103f34:	89 d0                	mov    %edx,%eax
  103f36:	c1 e0 02             	shl    $0x2,%eax
  103f39:	01 d0                	add    %edx,%eax
  103f3b:	c1 e0 02             	shl    $0x2,%eax
  103f3e:	01 c8                	add    %ecx,%eax
  103f40:	8b 48 0c             	mov    0xc(%eax),%ecx
  103f43:	8b 58 10             	mov    0x10(%eax),%ebx
  103f46:	8b 55 84             	mov    -0x7c(%ebp),%edx
  103f49:	89 54 24 1c          	mov    %edx,0x1c(%esp)
  103f4d:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
  103f53:	8b 95 7c ff ff ff    	mov    -0x84(%ebp),%edx
  103f59:	89 44 24 14          	mov    %eax,0x14(%esp)
  103f5d:	89 54 24 18          	mov    %edx,0x18(%esp)
  103f61:	8b 45 a0             	mov    -0x60(%ebp),%eax
  103f64:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  103f67:	89 44 24 0c          	mov    %eax,0xc(%esp)
  103f6b:	89 54 24 10          	mov    %edx,0x10(%esp)
  103f6f:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  103f73:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  103f77:	c7 04 24 7c 9e 10 00 	movl   $0x109e7c,(%esp)
  103f7e:	e8 32 c3 ff ff       	call   1002b5 <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) {
  103f83:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103f86:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103f89:	89 d0                	mov    %edx,%eax
  103f8b:	c1 e0 02             	shl    $0x2,%eax
  103f8e:	01 d0                	add    %edx,%eax
  103f90:	c1 e0 02             	shl    $0x2,%eax
  103f93:	01 c8                	add    %ecx,%eax
  103f95:	83 c0 14             	add    $0x14,%eax
  103f98:	8b 00                	mov    (%eax),%eax
  103f9a:	83 f8 01             	cmp    $0x1,%eax
  103f9d:	75 2e                	jne    103fcd <page_init+0x154>
            if (maxpa < end && begin < KMEMSIZE) {
  103f9f:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103fa2:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  103fa5:	3b 45 98             	cmp    -0x68(%ebp),%eax
  103fa8:	89 d0                	mov    %edx,%eax
  103faa:	1b 45 9c             	sbb    -0x64(%ebp),%eax
  103fad:	73 1e                	jae    103fcd <page_init+0x154>
  103faf:	ba ff ff ff 37       	mov    $0x37ffffff,%edx
  103fb4:	b8 00 00 00 00       	mov    $0x0,%eax
  103fb9:	3b 55 a0             	cmp    -0x60(%ebp),%edx
  103fbc:	1b 45 a4             	sbb    -0x5c(%ebp),%eax
  103fbf:	72 0c                	jb     103fcd <page_init+0x154>
                maxpa = end;
  103fc1:	8b 45 98             	mov    -0x68(%ebp),%eax
  103fc4:	8b 55 9c             	mov    -0x64(%ebp),%edx
  103fc7:	89 45 e0             	mov    %eax,-0x20(%ebp)
  103fca:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    for (i = 0; i < memmap->nr_map; i ++) {
  103fcd:	ff 45 dc             	incl   -0x24(%ebp)
  103fd0:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  103fd3:	8b 00                	mov    (%eax),%eax
  103fd5:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  103fd8:	0f 8c d8 fe ff ff    	jl     103eb6 <page_init+0x3d>
            }
        }
    }
    if (maxpa > KMEMSIZE) {
  103fde:	ba 00 00 00 38       	mov    $0x38000000,%edx
  103fe3:	b8 00 00 00 00       	mov    $0x0,%eax
  103fe8:	3b 55 e0             	cmp    -0x20(%ebp),%edx
  103feb:	1b 45 e4             	sbb    -0x1c(%ebp),%eax
  103fee:	73 0e                	jae    103ffe <page_init+0x185>
        maxpa = KMEMSIZE;
  103ff0:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
  103ff7:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];

    npage = maxpa / PGSIZE;
  103ffe:	8b 45 e0             	mov    -0x20(%ebp),%eax
  104001:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  104004:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  104008:	c1 ea 0c             	shr    $0xc,%edx
  10400b:	a3 80 6e 12 00       	mov    %eax,0x126e80
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
  104010:	c7 45 c0 00 10 00 00 	movl   $0x1000,-0x40(%ebp)
  104017:	b8 d0 da 2a 00       	mov    $0x2adad0,%eax
  10401c:	8d 50 ff             	lea    -0x1(%eax),%edx
  10401f:	8b 45 c0             	mov    -0x40(%ebp),%eax
  104022:	01 d0                	add    %edx,%eax
  104024:	89 45 bc             	mov    %eax,-0x44(%ebp)
  104027:	8b 45 bc             	mov    -0x44(%ebp),%eax
  10402a:	ba 00 00 00 00       	mov    $0x0,%edx
  10402f:	f7 75 c0             	divl   -0x40(%ebp)
  104032:	8b 45 bc             	mov    -0x44(%ebp),%eax
  104035:	29 d0                	sub    %edx,%eax
  104037:	a3 08 da 2a 00       	mov    %eax,0x2ada08

    for (i = 0; i < npage; i ++) {
  10403c:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  104043:	eb 2f                	jmp    104074 <page_init+0x1fb>
        SetPageReserved(pages + i);
  104045:	8b 0d 08 da 2a 00    	mov    0x2ada08,%ecx
  10404b:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10404e:	89 d0                	mov    %edx,%eax
  104050:	c1 e0 03             	shl    $0x3,%eax
  104053:	01 d0                	add    %edx,%eax
  104055:	c1 e0 02             	shl    $0x2,%eax
  104058:	01 c8                	add    %ecx,%eax
  10405a:	83 c0 04             	add    $0x4,%eax
  10405d:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
  104064:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  104067:	8b 45 90             	mov    -0x70(%ebp),%eax
  10406a:	8b 55 94             	mov    -0x6c(%ebp),%edx
  10406d:	0f ab 10             	bts    %edx,(%eax)
}
  104070:	90                   	nop
    for (i = 0; i < npage; i ++) {
  104071:	ff 45 dc             	incl   -0x24(%ebp)
  104074:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104077:	a1 80 6e 12 00       	mov    0x126e80,%eax
  10407c:	39 c2                	cmp    %eax,%edx
  10407e:	72 c5                	jb     104045 <page_init+0x1cc>
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
  104080:	8b 15 80 6e 12 00    	mov    0x126e80,%edx
  104086:	89 d0                	mov    %edx,%eax
  104088:	c1 e0 03             	shl    $0x3,%eax
  10408b:	01 d0                	add    %edx,%eax
  10408d:	c1 e0 02             	shl    $0x2,%eax
  104090:	89 c2                	mov    %eax,%edx
  104092:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  104097:	01 d0                	add    %edx,%eax
  104099:	89 45 b8             	mov    %eax,-0x48(%ebp)
  10409c:	81 7d b8 ff ff ff bf 	cmpl   $0xbfffffff,-0x48(%ebp)
  1040a3:	77 23                	ja     1040c8 <page_init+0x24f>
  1040a5:	8b 45 b8             	mov    -0x48(%ebp),%eax
  1040a8:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1040ac:	c7 44 24 08 ac 9e 10 	movl   $0x109eac,0x8(%esp)
  1040b3:	00 
  1040b4:	c7 44 24 04 dd 00 00 	movl   $0xdd,0x4(%esp)
  1040bb:	00 
  1040bc:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1040c3:	e8 59 c3 ff ff       	call   100421 <__panic>
  1040c8:	8b 45 b8             	mov    -0x48(%ebp),%eax
  1040cb:	05 00 00 00 40       	add    $0x40000000,%eax
  1040d0:	89 45 b4             	mov    %eax,-0x4c(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {
  1040d3:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  1040da:	e9 63 01 00 00       	jmp    104242 <page_init+0x3c9>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
  1040df:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  1040e2:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1040e5:	89 d0                	mov    %edx,%eax
  1040e7:	c1 e0 02             	shl    $0x2,%eax
  1040ea:	01 d0                	add    %edx,%eax
  1040ec:	c1 e0 02             	shl    $0x2,%eax
  1040ef:	01 c8                	add    %ecx,%eax
  1040f1:	8b 50 08             	mov    0x8(%eax),%edx
  1040f4:	8b 40 04             	mov    0x4(%eax),%eax
  1040f7:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1040fa:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  1040fd:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  104100:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104103:	89 d0                	mov    %edx,%eax
  104105:	c1 e0 02             	shl    $0x2,%eax
  104108:	01 d0                	add    %edx,%eax
  10410a:	c1 e0 02             	shl    $0x2,%eax
  10410d:	01 c8                	add    %ecx,%eax
  10410f:	8b 48 0c             	mov    0xc(%eax),%ecx
  104112:	8b 58 10             	mov    0x10(%eax),%ebx
  104115:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104118:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  10411b:	01 c8                	add    %ecx,%eax
  10411d:	11 da                	adc    %ebx,%edx
  10411f:	89 45 c8             	mov    %eax,-0x38(%ebp)
  104122:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {
  104125:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  104128:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10412b:	89 d0                	mov    %edx,%eax
  10412d:	c1 e0 02             	shl    $0x2,%eax
  104130:	01 d0                	add    %edx,%eax
  104132:	c1 e0 02             	shl    $0x2,%eax
  104135:	01 c8                	add    %ecx,%eax
  104137:	83 c0 14             	add    $0x14,%eax
  10413a:	8b 00                	mov    (%eax),%eax
  10413c:	83 f8 01             	cmp    $0x1,%eax
  10413f:	0f 85 fa 00 00 00    	jne    10423f <page_init+0x3c6>
            if (begin < freemem) {
  104145:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  104148:	ba 00 00 00 00       	mov    $0x0,%edx
  10414d:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  104150:	39 45 d0             	cmp    %eax,-0x30(%ebp)
  104153:	19 d1                	sbb    %edx,%ecx
  104155:	73 0d                	jae    104164 <page_init+0x2eb>
                begin = freemem;
  104157:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  10415a:	89 45 d0             	mov    %eax,-0x30(%ebp)
  10415d:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {
  104164:	ba 00 00 00 38       	mov    $0x38000000,%edx
  104169:	b8 00 00 00 00       	mov    $0x0,%eax
  10416e:	3b 55 c8             	cmp    -0x38(%ebp),%edx
  104171:	1b 45 cc             	sbb    -0x34(%ebp),%eax
  104174:	73 0e                	jae    104184 <page_init+0x30b>
                end = KMEMSIZE;
  104176:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
  10417d:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {
  104184:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104187:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  10418a:	3b 45 c8             	cmp    -0x38(%ebp),%eax
  10418d:	89 d0                	mov    %edx,%eax
  10418f:	1b 45 cc             	sbb    -0x34(%ebp),%eax
  104192:	0f 83 a7 00 00 00    	jae    10423f <page_init+0x3c6>
                begin = ROUNDUP(begin, PGSIZE);
  104198:	c7 45 b0 00 10 00 00 	movl   $0x1000,-0x50(%ebp)
  10419f:	8b 55 d0             	mov    -0x30(%ebp),%edx
  1041a2:	8b 45 b0             	mov    -0x50(%ebp),%eax
  1041a5:	01 d0                	add    %edx,%eax
  1041a7:	48                   	dec    %eax
  1041a8:	89 45 ac             	mov    %eax,-0x54(%ebp)
  1041ab:	8b 45 ac             	mov    -0x54(%ebp),%eax
  1041ae:	ba 00 00 00 00       	mov    $0x0,%edx
  1041b3:	f7 75 b0             	divl   -0x50(%ebp)
  1041b6:	8b 45 ac             	mov    -0x54(%ebp),%eax
  1041b9:	29 d0                	sub    %edx,%eax
  1041bb:	ba 00 00 00 00       	mov    $0x0,%edx
  1041c0:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1041c3:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);
  1041c6:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1041c9:	89 45 a8             	mov    %eax,-0x58(%ebp)
  1041cc:	8b 45 a8             	mov    -0x58(%ebp),%eax
  1041cf:	ba 00 00 00 00       	mov    $0x0,%edx
  1041d4:	89 c3                	mov    %eax,%ebx
  1041d6:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  1041dc:	89 de                	mov    %ebx,%esi
  1041de:	89 d0                	mov    %edx,%eax
  1041e0:	83 e0 00             	and    $0x0,%eax
  1041e3:	89 c7                	mov    %eax,%edi
  1041e5:	89 75 c8             	mov    %esi,-0x38(%ebp)
  1041e8:	89 7d cc             	mov    %edi,-0x34(%ebp)
                if (begin < end) {
  1041eb:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1041ee:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1041f1:	3b 45 c8             	cmp    -0x38(%ebp),%eax
  1041f4:	89 d0                	mov    %edx,%eax
  1041f6:	1b 45 cc             	sbb    -0x34(%ebp),%eax
  1041f9:	73 44                	jae    10423f <page_init+0x3c6>
                    first_ppn = page2ppn(pa2page(begin));
  1041fb:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1041fe:	89 04 24             	mov    %eax,(%esp)
  104201:	e8 c2 f8 ff ff       	call   103ac8 <pa2page>
  104206:	89 04 24             	mov    %eax,(%esp)
  104209:	e8 8a f8 ff ff       	call   103a98 <page2ppn>
  10420e:	a3 84 6e 12 00       	mov    %eax,0x126e84
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
  104213:	8b 45 c8             	mov    -0x38(%ebp),%eax
  104216:	8b 55 cc             	mov    -0x34(%ebp),%edx
  104219:	2b 45 d0             	sub    -0x30(%ebp),%eax
  10421c:	1b 55 d4             	sbb    -0x2c(%ebp),%edx
  10421f:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  104223:	c1 ea 0c             	shr    $0xc,%edx
  104226:	89 c3                	mov    %eax,%ebx
  104228:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10422b:	89 04 24             	mov    %eax,(%esp)
  10422e:	e8 95 f8 ff ff       	call   103ac8 <pa2page>
  104233:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  104237:	89 04 24             	mov    %eax,(%esp)
  10423a:	e8 74 fb ff ff       	call   103db3 <init_memmap>
    for (i = 0; i < memmap->nr_map; i ++) {
  10423f:	ff 45 dc             	incl   -0x24(%ebp)
  104242:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  104245:	8b 00                	mov    (%eax),%eax
  104247:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  10424a:	0f 8c 8f fe ff ff    	jl     1040df <page_init+0x266>
                }
            }
        }
    }
}
  104250:	90                   	nop
  104251:	90                   	nop
  104252:	81 c4 9c 00 00 00    	add    $0x9c,%esp
  104258:	5b                   	pop    %ebx
  104259:	5e                   	pop    %esi
  10425a:	5f                   	pop    %edi
  10425b:	5d                   	pop    %ebp
  10425c:	c3                   	ret    

0010425d <boot_map_segment>:
//  la:   linear address of this memory need to map (after x86 segment map)
//  size: memory size
//  pa:   physical address of this memory
//  perm: permission of this memory  
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
  10425d:	f3 0f 1e fb          	endbr32 
  104261:	55                   	push   %ebp
  104262:	89 e5                	mov    %esp,%ebp
  104264:	83 ec 38             	sub    $0x38,%esp
    assert(PGOFF(la) == PGOFF(pa));
  104267:	8b 45 0c             	mov    0xc(%ebp),%eax
  10426a:	33 45 14             	xor    0x14(%ebp),%eax
  10426d:	25 ff 0f 00 00       	and    $0xfff,%eax
  104272:	85 c0                	test   %eax,%eax
  104274:	74 24                	je     10429a <boot_map_segment+0x3d>
  104276:	c7 44 24 0c de 9e 10 	movl   $0x109ede,0xc(%esp)
  10427d:	00 
  10427e:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104285:	00 
  104286:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
  10428d:	00 
  10428e:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104295:	e8 87 c1 ff ff       	call   100421 <__panic>
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
  10429a:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
  1042a1:	8b 45 0c             	mov    0xc(%ebp),%eax
  1042a4:	25 ff 0f 00 00       	and    $0xfff,%eax
  1042a9:	89 c2                	mov    %eax,%edx
  1042ab:	8b 45 10             	mov    0x10(%ebp),%eax
  1042ae:	01 c2                	add    %eax,%edx
  1042b0:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1042b3:	01 d0                	add    %edx,%eax
  1042b5:	48                   	dec    %eax
  1042b6:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1042b9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1042bc:	ba 00 00 00 00       	mov    $0x0,%edx
  1042c1:	f7 75 f0             	divl   -0x10(%ebp)
  1042c4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1042c7:	29 d0                	sub    %edx,%eax
  1042c9:	c1 e8 0c             	shr    $0xc,%eax
  1042cc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    la = ROUNDDOWN(la, PGSIZE);
  1042cf:	8b 45 0c             	mov    0xc(%ebp),%eax
  1042d2:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1042d5:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1042d8:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1042dd:	89 45 0c             	mov    %eax,0xc(%ebp)
    pa = ROUNDDOWN(pa, PGSIZE);
  1042e0:	8b 45 14             	mov    0x14(%ebp),%eax
  1042e3:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1042e6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1042e9:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1042ee:	89 45 14             	mov    %eax,0x14(%ebp)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
  1042f1:	eb 68                	jmp    10435b <boot_map_segment+0xfe>
        pte_t *ptep = get_pte(pgdir, la, 1);
  1042f3:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  1042fa:	00 
  1042fb:	8b 45 0c             	mov    0xc(%ebp),%eax
  1042fe:	89 44 24 04          	mov    %eax,0x4(%esp)
  104302:	8b 45 08             	mov    0x8(%ebp),%eax
  104305:	89 04 24             	mov    %eax,(%esp)
  104308:	e8 91 01 00 00       	call   10449e <get_pte>
  10430d:	89 45 e0             	mov    %eax,-0x20(%ebp)
        assert(ptep != NULL);
  104310:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  104314:	75 24                	jne    10433a <boot_map_segment+0xdd>
  104316:	c7 44 24 0c 0a 9f 10 	movl   $0x109f0a,0xc(%esp)
  10431d:	00 
  10431e:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104325:	00 
  104326:	c7 44 24 04 02 01 00 	movl   $0x102,0x4(%esp)
  10432d:	00 
  10432e:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104335:	e8 e7 c0 ff ff       	call   100421 <__panic>
        *ptep = pa | PTE_P | perm;
  10433a:	8b 45 14             	mov    0x14(%ebp),%eax
  10433d:	0b 45 18             	or     0x18(%ebp),%eax
  104340:	83 c8 01             	or     $0x1,%eax
  104343:	89 c2                	mov    %eax,%edx
  104345:	8b 45 e0             	mov    -0x20(%ebp),%eax
  104348:	89 10                	mov    %edx,(%eax)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
  10434a:	ff 4d f4             	decl   -0xc(%ebp)
  10434d:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
  104354:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
  10435b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10435f:	75 92                	jne    1042f3 <boot_map_segment+0x96>
    }
}
  104361:	90                   	nop
  104362:	90                   	nop
  104363:	c9                   	leave  
  104364:	c3                   	ret    

00104365 <boot_alloc_page>:

//boot_alloc_page - allocate one page using pmm->alloc_pages(1) 
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
static void *
boot_alloc_page(void) {
  104365:	f3 0f 1e fb          	endbr32 
  104369:	55                   	push   %ebp
  10436a:	89 e5                	mov    %esp,%ebp
  10436c:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();
  10436f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104376:	e8 5c fa ff ff       	call   103dd7 <alloc_pages>
  10437b:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {
  10437e:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104382:	75 1c                	jne    1043a0 <boot_alloc_page+0x3b>
        panic("boot_alloc_page failed.\n");
  104384:	c7 44 24 08 17 9f 10 	movl   $0x109f17,0x8(%esp)
  10438b:	00 
  10438c:	c7 44 24 04 0e 01 00 	movl   $0x10e,0x4(%esp)
  104393:	00 
  104394:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  10439b:	e8 81 c0 ff ff       	call   100421 <__panic>
    }
    return page2kva(p);
  1043a0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1043a3:	89 04 24             	mov    %eax,(%esp)
  1043a6:	e8 6c f7 ff ff       	call   103b17 <page2kva>
}
  1043ab:	c9                   	leave  
  1043ac:	c3                   	ret    

001043ad <pmm_init>:

//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
void
pmm_init(void) {
  1043ad:	f3 0f 1e fb          	endbr32 
  1043b1:	55                   	push   %ebp
  1043b2:	89 e5                	mov    %esp,%ebp
  1043b4:	83 ec 38             	sub    $0x38,%esp
    // We've already enabled paging
    boot_cr3 = PADDR(boot_pgdir);
  1043b7:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  1043bc:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1043bf:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
  1043c6:	77 23                	ja     1043eb <pmm_init+0x3e>
  1043c8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1043cb:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1043cf:	c7 44 24 08 ac 9e 10 	movl   $0x109eac,0x8(%esp)
  1043d6:	00 
  1043d7:	c7 44 24 04 18 01 00 	movl   $0x118,0x4(%esp)
  1043de:	00 
  1043df:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1043e6:	e8 36 c0 ff ff       	call   100421 <__panic>
  1043eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1043ee:	05 00 00 00 40       	add    $0x40000000,%eax
  1043f3:	a3 04 da 2a 00       	mov    %eax,0x2ada04
    //We need to alloc/free the physical memory (granularity is 4KB or other size). 
    //So a framework of physical memory manager (struct pmm_manager)is defined in pmm.h
    //First we should init a physical memory manager(pmm) based on the framework.
    //Then pmm can alloc/free the physical memory. 
    //Now the first_fit/best_fit/worst_fit/buddy_system pmm are available.
    init_pmm_manager();
  1043f8:	e8 7e f9 ff ff       	call   103d7b <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    page_init();
  1043fd:	e8 77 fa ff ff       	call   103e79 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    check_alloc_page();
  104402:	e8 8e 04 00 00       	call   104895 <check_alloc_page>

    check_pgdir();
  104407:	e8 ac 04 00 00       	call   1048b8 <check_pgdir>

    static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
  10440c:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104411:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104414:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
  10441b:	77 23                	ja     104440 <pmm_init+0x93>
  10441d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104420:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104424:	c7 44 24 08 ac 9e 10 	movl   $0x109eac,0x8(%esp)
  10442b:	00 
  10442c:	c7 44 24 04 2e 01 00 	movl   $0x12e,0x4(%esp)
  104433:	00 
  104434:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  10443b:	e8 e1 bf ff ff       	call   100421 <__panic>
  104440:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104443:	8d 90 00 00 00 40    	lea    0x40000000(%eax),%edx
  104449:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  10444e:	05 ac 0f 00 00       	add    $0xfac,%eax
  104453:	83 ca 03             	or     $0x3,%edx
  104456:	89 10                	mov    %edx,(%eax)

    // map all physical memory to linear memory with base linear addr KERNBASE
    // linear_addr KERNBASE ~ KERNBASE + KMEMSIZE = phy_addr 0 ~ KMEMSIZE
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
  104458:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  10445d:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
  104464:	00 
  104465:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  10446c:	00 
  10446d:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
  104474:	38 
  104475:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
  10447c:	c0 
  10447d:	89 04 24             	mov    %eax,(%esp)
  104480:	e8 d8 fd ff ff       	call   10425d <boot_map_segment>

    // Since we are using bootloader's GDT,
    // we should reload gdt (second time, the last time) to get user segments and the TSS
    // map virtual_addr 0 ~ 4G = linear_addr 0 ~ 4G
    // then set kernel stack (ss:esp) in TSS, setup TSS in gdt, load TSS
    gdt_init();
  104485:	e8 03 f8 ff ff       	call   103c8d <gdt_init>

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
    check_boot_pgdir();
  10448a:	e8 c9 0a 00 00       	call   104f58 <check_boot_pgdir>

    print_pgdir();
  10448f:	e8 4e 0f 00 00       	call   1053e2 <print_pgdir>
    check();
  104494:	a1 44 3a 12 00       	mov    0x123a44,%eax
  104499:	ff d0                	call   *%eax

}
  10449b:	90                   	nop
  10449c:	c9                   	leave  
  10449d:	c3                   	ret    

0010449e <get_pte>:
//  pgdir:  the kernel virtual base address of PDT
//  la:     the linear address need to map
//  create: a logical value to decide if alloc a page for PT
// return vaule: the kernel virtual address of this pte
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
  10449e:	f3 0f 1e fb          	endbr32 
  1044a2:	55                   	push   %ebp
  1044a3:	89 e5                	mov    %esp,%ebp
  1044a5:	83 ec 58             	sub    $0x58,%esp
                          // (7) set page directory entry's permission
    }
    return NULL;          // (8) return page table entry
#endif
    //得到对应的pde下标
    uint32_t pde_idx = PDX(la);
  1044a8:	8b 45 0c             	mov    0xc(%ebp),%eax
  1044ab:	c1 e8 16             	shr    $0x16,%eax
  1044ae:	89 45 f0             	mov    %eax,-0x10(%ebp)
    //找到对应pte
    uint32_t *pde_tar = (uint32_t)pgdir + (pde_idx<<2);
  1044b1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1044b4:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  1044bb:	8b 45 08             	mov    0x8(%ebp),%eax
  1044be:	01 d0                	add    %edx,%eax
  1044c0:	89 45 ec             	mov    %eax,-0x14(%ebp)
    uint32_t pte_idx = NULL;
  1044c3:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
    uint32_t *pte_tar = NULL;
  1044ca:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    uint32_t exi_page;

    //观察是否存在表项
    if (!(*pde_tar & PTE_P))
  1044d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1044d4:	8b 00                	mov    (%eax),%eax
  1044d6:	83 e0 01             	and    $0x1,%eax
  1044d9:	85 c0                	test   %eax,%eax
  1044db:	0f 85 1b 01 00 00    	jne    1045fc <get_pte+0x15e>
    {
        //如果需要创建
        if (create)
  1044e1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  1044e5:	0f 84 0a 01 00 00    	je     1045f5 <get_pte+0x157>
        {
            //申请一个二级页表的空间，并且设置引用数
            struct Page *new_page = alloc_page();
  1044eb:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1044f2:	e8 e0 f8 ff ff       	call   103dd7 <alloc_pages>
  1044f7:	89 45 d8             	mov    %eax,-0x28(%ebp)
            if(new_page==NULL)
  1044fa:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  1044fe:	75 0a                	jne    10450a <get_pte+0x6c>
            	return NULL;
  104500:	b8 00 00 00 00       	mov    $0x0,%eax
  104505:	e9 63 01 00 00       	jmp    10466d <get_pte+0x1cf>
            set_page_ref(new_page, 1);
  10450a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104511:	00 
  104512:	8b 45 d8             	mov    -0x28(%ebp),%eax
  104515:	89 04 24             	mov    %eax,(%esp)
  104518:	e8 ae f6 ff ff       	call   103bcb <set_page_ref>
            //获得该二级页表所对应的物理地址，初始化二级页表后，将其填入pde
            uintptr_t pt_addr = page2pa(new_page);
  10451d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  104520:	89 04 24             	mov    %eax,(%esp)
  104523:	e8 8a f5 ff ff       	call   103ab2 <page2pa>
  104528:	89 45 d4             	mov    %eax,-0x2c(%ebp)
            memset(KADDR(pt_addr),0x0,PGSIZE);
  10452b:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10452e:	89 45 d0             	mov    %eax,-0x30(%ebp)
  104531:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104534:	c1 e8 0c             	shr    $0xc,%eax
  104537:	89 45 cc             	mov    %eax,-0x34(%ebp)
  10453a:	a1 80 6e 12 00       	mov    0x126e80,%eax
  10453f:	39 45 cc             	cmp    %eax,-0x34(%ebp)
  104542:	72 23                	jb     104567 <get_pte+0xc9>
  104544:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104547:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10454b:	c7 44 24 08 08 9e 10 	movl   $0x109e08,0x8(%esp)
  104552:	00 
  104553:	c7 44 24 04 82 01 00 	movl   $0x182,0x4(%esp)
  10455a:	00 
  10455b:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104562:	e8 ba be ff ff       	call   100421 <__panic>
  104567:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10456a:	2d 00 00 00 40       	sub    $0x40000000,%eax
  10456f:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104576:	00 
  104577:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  10457e:	00 
  10457f:	89 04 24             	mov    %eax,(%esp)
  104582:	e8 57 47 00 00       	call   108cde <memset>
            *pde_tar = pt_addr| PTE_P | PTE_W | PTE_U;
  104587:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10458a:	83 c8 07             	or     $0x7,%eax
  10458d:	89 c2                	mov    %eax,%edx
  10458f:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104592:	89 10                	mov    %edx,(%eax)
            pte_idx = PTX(la);
  104594:	8b 45 0c             	mov    0xc(%ebp),%eax
  104597:	c1 e8 0c             	shr    $0xc,%eax
  10459a:	25 ff 03 00 00       	and    $0x3ff,%eax
  10459f:	89 45 e8             	mov    %eax,-0x18(%ebp)
            pte_tar = KADDR(pt_addr) + (pte_idx << 2);
  1045a2:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1045a5:	89 45 c8             	mov    %eax,-0x38(%ebp)
  1045a8:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1045ab:	c1 e8 0c             	shr    $0xc,%eax
  1045ae:	89 45 c4             	mov    %eax,-0x3c(%ebp)
  1045b1:	a1 80 6e 12 00       	mov    0x126e80,%eax
  1045b6:	39 45 c4             	cmp    %eax,-0x3c(%ebp)
  1045b9:	72 23                	jb     1045de <get_pte+0x140>
  1045bb:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1045be:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1045c2:	c7 44 24 08 08 9e 10 	movl   $0x109e08,0x8(%esp)
  1045c9:	00 
  1045ca:	c7 44 24 04 85 01 00 	movl   $0x185,0x4(%esp)
  1045d1:	00 
  1045d2:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1045d9:	e8 43 be ff ff       	call   100421 <__panic>
  1045de:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1045e1:	2d 00 00 00 40       	sub    $0x40000000,%eax
  1045e6:	89 c2                	mov    %eax,%edx
  1045e8:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1045eb:	c1 e0 02             	shl    $0x2,%eax
  1045ee:	01 d0                	add    %edx,%eax
  1045f0:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1045f3:	eb 75                	jmp    10466a <get_pte+0x1cc>
        }
        else
        {
            return NULL;
  1045f5:	b8 00 00 00 00       	mov    $0x0,%eax
  1045fa:	eb 71                	jmp    10466d <get_pte+0x1cf>
        }
    }
    else
    {
        //获得二级页表的线性地址
        exi_page = (uint32_t)KADDR(*pde_tar) & 0xfffff000;
  1045fc:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1045ff:	8b 00                	mov    (%eax),%eax
  104601:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  104604:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104607:	c1 e8 0c             	shr    $0xc,%eax
  10460a:	89 45 e0             	mov    %eax,-0x20(%ebp)
  10460d:	a1 80 6e 12 00       	mov    0x126e80,%eax
  104612:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  104615:	72 23                	jb     10463a <get_pte+0x19c>
  104617:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10461a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10461e:	c7 44 24 08 08 9e 10 	movl   $0x109e08,0x8(%esp)
  104625:	00 
  104626:	c7 44 24 04 8f 01 00 	movl   $0x18f,0x4(%esp)
  10462d:	00 
  10462e:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104635:	e8 e7 bd ff ff       	call   100421 <__panic>
  10463a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10463d:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104642:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104647:	89 45 dc             	mov    %eax,-0x24(%ebp)
        //计算对于pte的偏移
        pte_idx = PTX(la);
  10464a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10464d:	c1 e8 0c             	shr    $0xc,%eax
  104650:	25 ff 03 00 00       	and    $0x3ff,%eax
  104655:	89 45 e8             	mov    %eax,-0x18(%ebp)
        pte_tar = exi_page + (pte_idx << 2);
  104658:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10465b:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  104662:	8b 45 dc             	mov    -0x24(%ebp),%eax
  104665:	01 d0                	add    %edx,%eax
  104667:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    return (pte_t*)pte_tar;
  10466a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  10466d:	c9                   	leave  
  10466e:	c3                   	ret    

0010466f <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
  10466f:	f3 0f 1e fb          	endbr32 
  104673:	55                   	push   %ebp
  104674:	89 e5                	mov    %esp,%ebp
  104676:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
  104679:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104680:	00 
  104681:	8b 45 0c             	mov    0xc(%ebp),%eax
  104684:	89 44 24 04          	mov    %eax,0x4(%esp)
  104688:	8b 45 08             	mov    0x8(%ebp),%eax
  10468b:	89 04 24             	mov    %eax,(%esp)
  10468e:	e8 0b fe ff ff       	call   10449e <get_pte>
  104693:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep_store != NULL) {
  104696:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  10469a:	74 08                	je     1046a4 <get_page+0x35>
        *ptep_store = ptep;
  10469c:	8b 45 10             	mov    0x10(%ebp),%eax
  10469f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1046a2:	89 10                	mov    %edx,(%eax)
    }
    if (ptep != NULL && *ptep & PTE_P) {
  1046a4:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1046a8:	74 1b                	je     1046c5 <get_page+0x56>
  1046aa:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1046ad:	8b 00                	mov    (%eax),%eax
  1046af:	83 e0 01             	and    $0x1,%eax
  1046b2:	85 c0                	test   %eax,%eax
  1046b4:	74 0f                	je     1046c5 <get_page+0x56>
        return pte2page(*ptep);
  1046b6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1046b9:	8b 00                	mov    (%eax),%eax
  1046bb:	89 04 24             	mov    %eax,(%esp)
  1046be:	e8 a8 f4 ff ff       	call   103b6b <pte2page>
  1046c3:	eb 05                	jmp    1046ca <get_page+0x5b>
    }
    return NULL;
  1046c5:	b8 00 00 00 00       	mov    $0x0,%eax
}
  1046ca:	c9                   	leave  
  1046cb:	c3                   	ret    

001046cc <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
  1046cc:	55                   	push   %ebp
  1046cd:	89 e5                	mov    %esp,%ebp
  1046cf:	83 ec 28             	sub    $0x28,%esp
                                  //(4) and free this page when page reference reachs 0
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif
    if (*ptep & PTE_P) {
  1046d2:	8b 45 10             	mov    0x10(%ebp),%eax
  1046d5:	8b 00                	mov    (%eax),%eax
  1046d7:	83 e0 01             	and    $0x1,%eax
  1046da:	85 c0                	test   %eax,%eax
  1046dc:	74 4d                	je     10472b <page_remove_pte+0x5f>
        struct Page *page = pte2page(*ptep);
  1046de:	8b 45 10             	mov    0x10(%ebp),%eax
  1046e1:	8b 00                	mov    (%eax),%eax
  1046e3:	89 04 24             	mov    %eax,(%esp)
  1046e6:	e8 80 f4 ff ff       	call   103b6b <pte2page>
  1046eb:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (page_ref_dec(page) == 0) {
  1046ee:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1046f1:	89 04 24             	mov    %eax,(%esp)
  1046f4:	e8 f7 f4 ff ff       	call   103bf0 <page_ref_dec>
  1046f9:	85 c0                	test   %eax,%eax
  1046fb:	75 13                	jne    104710 <page_remove_pte+0x44>
            free_page(page);
  1046fd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104704:	00 
  104705:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104708:	89 04 24             	mov    %eax,(%esp)
  10470b:	e8 03 f7 ff ff       	call   103e13 <free_pages>
        }
        *ptep = 0;
  104710:	8b 45 10             	mov    0x10(%ebp),%eax
  104713:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
        tlb_invalidate(pgdir, la);
  104719:	8b 45 0c             	mov    0xc(%ebp),%eax
  10471c:	89 44 24 04          	mov    %eax,0x4(%esp)
  104720:	8b 45 08             	mov    0x8(%ebp),%eax
  104723:	89 04 24             	mov    %eax,(%esp)
  104726:	e8 09 01 00 00       	call   104834 <tlb_invalidate>
    }
}
  10472b:	90                   	nop
  10472c:	c9                   	leave  
  10472d:	c3                   	ret    

0010472e <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
void
page_remove(pde_t *pgdir, uintptr_t la) {
  10472e:	f3 0f 1e fb          	endbr32 
  104732:	55                   	push   %ebp
  104733:	89 e5                	mov    %esp,%ebp
  104735:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
  104738:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  10473f:	00 
  104740:	8b 45 0c             	mov    0xc(%ebp),%eax
  104743:	89 44 24 04          	mov    %eax,0x4(%esp)
  104747:	8b 45 08             	mov    0x8(%ebp),%eax
  10474a:	89 04 24             	mov    %eax,(%esp)
  10474d:	e8 4c fd ff ff       	call   10449e <get_pte>
  104752:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep != NULL) {
  104755:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104759:	74 19                	je     104774 <page_remove+0x46>
        page_remove_pte(pgdir, la, ptep);
  10475b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10475e:	89 44 24 08          	mov    %eax,0x8(%esp)
  104762:	8b 45 0c             	mov    0xc(%ebp),%eax
  104765:	89 44 24 04          	mov    %eax,0x4(%esp)
  104769:	8b 45 08             	mov    0x8(%ebp),%eax
  10476c:	89 04 24             	mov    %eax,(%esp)
  10476f:	e8 58 ff ff ff       	call   1046cc <page_remove_pte>
    }
}
  104774:	90                   	nop
  104775:	c9                   	leave  
  104776:	c3                   	ret    

00104777 <page_insert>:
//  la:    the linear address need to map
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
  104777:	f3 0f 1e fb          	endbr32 
  10477b:	55                   	push   %ebp
  10477c:	89 e5                	mov    %esp,%ebp
  10477e:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 1);
  104781:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  104788:	00 
  104789:	8b 45 10             	mov    0x10(%ebp),%eax
  10478c:	89 44 24 04          	mov    %eax,0x4(%esp)
  104790:	8b 45 08             	mov    0x8(%ebp),%eax
  104793:	89 04 24             	mov    %eax,(%esp)
  104796:	e8 03 fd ff ff       	call   10449e <get_pte>
  10479b:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep == NULL) {
  10479e:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1047a2:	75 0a                	jne    1047ae <page_insert+0x37>
        return -E_NO_MEM;
  1047a4:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  1047a9:	e9 84 00 00 00       	jmp    104832 <page_insert+0xbb>
    }
    page_ref_inc(page);
  1047ae:	8b 45 0c             	mov    0xc(%ebp),%eax
  1047b1:	89 04 24             	mov    %eax,(%esp)
  1047b4:	e8 20 f4 ff ff       	call   103bd9 <page_ref_inc>
    if (*ptep & PTE_P) {
  1047b9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1047bc:	8b 00                	mov    (%eax),%eax
  1047be:	83 e0 01             	and    $0x1,%eax
  1047c1:	85 c0                	test   %eax,%eax
  1047c3:	74 3e                	je     104803 <page_insert+0x8c>
        struct Page *p = pte2page(*ptep);
  1047c5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1047c8:	8b 00                	mov    (%eax),%eax
  1047ca:	89 04 24             	mov    %eax,(%esp)
  1047cd:	e8 99 f3 ff ff       	call   103b6b <pte2page>
  1047d2:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
  1047d5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1047d8:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1047db:	75 0d                	jne    1047ea <page_insert+0x73>
            page_ref_dec(page);
  1047dd:	8b 45 0c             	mov    0xc(%ebp),%eax
  1047e0:	89 04 24             	mov    %eax,(%esp)
  1047e3:	e8 08 f4 ff ff       	call   103bf0 <page_ref_dec>
  1047e8:	eb 19                	jmp    104803 <page_insert+0x8c>
        }
        else {
            page_remove_pte(pgdir, la, ptep);
  1047ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1047ed:	89 44 24 08          	mov    %eax,0x8(%esp)
  1047f1:	8b 45 10             	mov    0x10(%ebp),%eax
  1047f4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1047f8:	8b 45 08             	mov    0x8(%ebp),%eax
  1047fb:	89 04 24             	mov    %eax,(%esp)
  1047fe:	e8 c9 fe ff ff       	call   1046cc <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
  104803:	8b 45 0c             	mov    0xc(%ebp),%eax
  104806:	89 04 24             	mov    %eax,(%esp)
  104809:	e8 a4 f2 ff ff       	call   103ab2 <page2pa>
  10480e:	0b 45 14             	or     0x14(%ebp),%eax
  104811:	83 c8 01             	or     $0x1,%eax
  104814:	89 c2                	mov    %eax,%edx
  104816:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104819:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);
  10481b:	8b 45 10             	mov    0x10(%ebp),%eax
  10481e:	89 44 24 04          	mov    %eax,0x4(%esp)
  104822:	8b 45 08             	mov    0x8(%ebp),%eax
  104825:	89 04 24             	mov    %eax,(%esp)
  104828:	e8 07 00 00 00       	call   104834 <tlb_invalidate>
    return 0;
  10482d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  104832:	c9                   	leave  
  104833:	c3                   	ret    

00104834 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
  104834:	f3 0f 1e fb          	endbr32 
  104838:	55                   	push   %ebp
  104839:	89 e5                	mov    %esp,%ebp
  10483b:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
  10483e:	0f 20 d8             	mov    %cr3,%eax
  104841:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
  104844:	8b 55 f0             	mov    -0x10(%ebp),%edx
    if (rcr3() == PADDR(pgdir)) {
  104847:	8b 45 08             	mov    0x8(%ebp),%eax
  10484a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10484d:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
  104854:	77 23                	ja     104879 <tlb_invalidate+0x45>
  104856:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104859:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10485d:	c7 44 24 08 ac 9e 10 	movl   $0x109eac,0x8(%esp)
  104864:	00 
  104865:	c7 44 24 04 f6 01 00 	movl   $0x1f6,0x4(%esp)
  10486c:	00 
  10486d:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104874:	e8 a8 bb ff ff       	call   100421 <__panic>
  104879:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10487c:	05 00 00 00 40       	add    $0x40000000,%eax
  104881:	39 d0                	cmp    %edx,%eax
  104883:	75 0d                	jne    104892 <tlb_invalidate+0x5e>
        invlpg((void *)la);
  104885:	8b 45 0c             	mov    0xc(%ebp),%eax
  104888:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
  10488b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10488e:	0f 01 38             	invlpg (%eax)
}
  104891:	90                   	nop
    }
}
  104892:	90                   	nop
  104893:	c9                   	leave  
  104894:	c3                   	ret    

00104895 <check_alloc_page>:

static void
check_alloc_page(void) {
  104895:	f3 0f 1e fb          	endbr32 
  104899:	55                   	push   %ebp
  10489a:	89 e5                	mov    %esp,%ebp
  10489c:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->check();
  10489f:	a1 00 da 2a 00       	mov    0x2ada00,%eax
  1048a4:	8b 40 18             	mov    0x18(%eax),%eax
  1048a7:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
  1048a9:	c7 04 24 30 9f 10 00 	movl   $0x109f30,(%esp)
  1048b0:	e8 00 ba ff ff       	call   1002b5 <cprintf>
}
  1048b5:	90                   	nop
  1048b6:	c9                   	leave  
  1048b7:	c3                   	ret    

001048b8 <check_pgdir>:

static void
check_pgdir(void) {
  1048b8:	f3 0f 1e fb          	endbr32 
  1048bc:	55                   	push   %ebp
  1048bd:	89 e5                	mov    %esp,%ebp
  1048bf:	83 ec 38             	sub    $0x38,%esp
    assert(npage <= KMEMSIZE / PGSIZE);
  1048c2:	a1 80 6e 12 00       	mov    0x126e80,%eax
  1048c7:	3d 00 80 03 00       	cmp    $0x38000,%eax
  1048cc:	76 24                	jbe    1048f2 <check_pgdir+0x3a>
  1048ce:	c7 44 24 0c 4f 9f 10 	movl   $0x109f4f,0xc(%esp)
  1048d5:	00 
  1048d6:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  1048dd:	00 
  1048de:	c7 44 24 04 03 02 00 	movl   $0x203,0x4(%esp)
  1048e5:	00 
  1048e6:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1048ed:	e8 2f bb ff ff       	call   100421 <__panic>
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
  1048f2:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  1048f7:	85 c0                	test   %eax,%eax
  1048f9:	74 0e                	je     104909 <check_pgdir+0x51>
  1048fb:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104900:	25 ff 0f 00 00       	and    $0xfff,%eax
  104905:	85 c0                	test   %eax,%eax
  104907:	74 24                	je     10492d <check_pgdir+0x75>
  104909:	c7 44 24 0c 6c 9f 10 	movl   $0x109f6c,0xc(%esp)
  104910:	00 
  104911:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104918:	00 
  104919:	c7 44 24 04 04 02 00 	movl   $0x204,0x4(%esp)
  104920:	00 
  104921:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104928:	e8 f4 ba ff ff       	call   100421 <__panic>
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
  10492d:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104932:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104939:	00 
  10493a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104941:	00 
  104942:	89 04 24             	mov    %eax,(%esp)
  104945:	e8 25 fd ff ff       	call   10466f <get_page>
  10494a:	85 c0                	test   %eax,%eax
  10494c:	74 24                	je     104972 <check_pgdir+0xba>
  10494e:	c7 44 24 0c a4 9f 10 	movl   $0x109fa4,0xc(%esp)
  104955:	00 
  104956:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  10495d:	00 
  10495e:	c7 44 24 04 05 02 00 	movl   $0x205,0x4(%esp)
  104965:	00 
  104966:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  10496d:	e8 af ba ff ff       	call   100421 <__panic>

    struct Page *p1, *p2;
    p1 = alloc_page();
  104972:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104979:	e8 59 f4 ff ff       	call   103dd7 <alloc_pages>
  10497e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
  104981:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104986:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  10498d:	00 
  10498e:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104995:	00 
  104996:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104999:	89 54 24 04          	mov    %edx,0x4(%esp)
  10499d:	89 04 24             	mov    %eax,(%esp)
  1049a0:	e8 d2 fd ff ff       	call   104777 <page_insert>
  1049a5:	85 c0                	test   %eax,%eax
  1049a7:	74 24                	je     1049cd <check_pgdir+0x115>
  1049a9:	c7 44 24 0c cc 9f 10 	movl   $0x109fcc,0xc(%esp)
  1049b0:	00 
  1049b1:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  1049b8:	00 
  1049b9:	c7 44 24 04 09 02 00 	movl   $0x209,0x4(%esp)
  1049c0:	00 
  1049c1:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1049c8:	e8 54 ba ff ff       	call   100421 <__panic>

    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
  1049cd:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  1049d2:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1049d9:	00 
  1049da:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1049e1:	00 
  1049e2:	89 04 24             	mov    %eax,(%esp)
  1049e5:	e8 b4 fa ff ff       	call   10449e <get_pte>
  1049ea:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1049ed:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  1049f1:	75 24                	jne    104a17 <check_pgdir+0x15f>
  1049f3:	c7 44 24 0c f8 9f 10 	movl   $0x109ff8,0xc(%esp)
  1049fa:	00 
  1049fb:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104a02:	00 
  104a03:	c7 44 24 04 0c 02 00 	movl   $0x20c,0x4(%esp)
  104a0a:	00 
  104a0b:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104a12:	e8 0a ba ff ff       	call   100421 <__panic>
    assert(pte2page(*ptep) == p1);
  104a17:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104a1a:	8b 00                	mov    (%eax),%eax
  104a1c:	89 04 24             	mov    %eax,(%esp)
  104a1f:	e8 47 f1 ff ff       	call   103b6b <pte2page>
  104a24:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  104a27:	74 24                	je     104a4d <check_pgdir+0x195>
  104a29:	c7 44 24 0c 25 a0 10 	movl   $0x10a025,0xc(%esp)
  104a30:	00 
  104a31:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104a38:	00 
  104a39:	c7 44 24 04 0d 02 00 	movl   $0x20d,0x4(%esp)
  104a40:	00 
  104a41:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104a48:	e8 d4 b9 ff ff       	call   100421 <__panic>
    assert(page_ref(p1) == 1);
  104a4d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104a50:	89 04 24             	mov    %eax,(%esp)
  104a53:	e8 69 f1 ff ff       	call   103bc1 <page_ref>
  104a58:	83 f8 01             	cmp    $0x1,%eax
  104a5b:	74 24                	je     104a81 <check_pgdir+0x1c9>
  104a5d:	c7 44 24 0c 3b a0 10 	movl   $0x10a03b,0xc(%esp)
  104a64:	00 
  104a65:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104a6c:	00 
  104a6d:	c7 44 24 04 0e 02 00 	movl   $0x20e,0x4(%esp)
  104a74:	00 
  104a75:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104a7c:	e8 a0 b9 ff ff       	call   100421 <__panic>

    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
  104a81:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104a86:	8b 00                	mov    (%eax),%eax
  104a88:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104a8d:	89 45 ec             	mov    %eax,-0x14(%ebp)
  104a90:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104a93:	c1 e8 0c             	shr    $0xc,%eax
  104a96:	89 45 e8             	mov    %eax,-0x18(%ebp)
  104a99:	a1 80 6e 12 00       	mov    0x126e80,%eax
  104a9e:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  104aa1:	72 23                	jb     104ac6 <check_pgdir+0x20e>
  104aa3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104aa6:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104aaa:	c7 44 24 08 08 9e 10 	movl   $0x109e08,0x8(%esp)
  104ab1:	00 
  104ab2:	c7 44 24 04 10 02 00 	movl   $0x210,0x4(%esp)
  104ab9:	00 
  104aba:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104ac1:	e8 5b b9 ff ff       	call   100421 <__panic>
  104ac6:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104ac9:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104ace:	83 c0 04             	add    $0x4,%eax
  104ad1:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
  104ad4:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104ad9:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104ae0:	00 
  104ae1:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104ae8:	00 
  104ae9:	89 04 24             	mov    %eax,(%esp)
  104aec:	e8 ad f9 ff ff       	call   10449e <get_pte>
  104af1:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  104af4:	74 24                	je     104b1a <check_pgdir+0x262>
  104af6:	c7 44 24 0c 50 a0 10 	movl   $0x10a050,0xc(%esp)
  104afd:	00 
  104afe:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104b05:	00 
  104b06:	c7 44 24 04 11 02 00 	movl   $0x211,0x4(%esp)
  104b0d:	00 
  104b0e:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104b15:	e8 07 b9 ff ff       	call   100421 <__panic>

    p2 = alloc_page();
  104b1a:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104b21:	e8 b1 f2 ff ff       	call   103dd7 <alloc_pages>
  104b26:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
  104b29:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104b2e:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  104b35:	00 
  104b36:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104b3d:	00 
  104b3e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  104b41:	89 54 24 04          	mov    %edx,0x4(%esp)
  104b45:	89 04 24             	mov    %eax,(%esp)
  104b48:	e8 2a fc ff ff       	call   104777 <page_insert>
  104b4d:	85 c0                	test   %eax,%eax
  104b4f:	74 24                	je     104b75 <check_pgdir+0x2bd>
  104b51:	c7 44 24 0c 78 a0 10 	movl   $0x10a078,0xc(%esp)
  104b58:	00 
  104b59:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104b60:	00 
  104b61:	c7 44 24 04 14 02 00 	movl   $0x214,0x4(%esp)
  104b68:	00 
  104b69:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104b70:	e8 ac b8 ff ff       	call   100421 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
  104b75:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104b7a:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104b81:	00 
  104b82:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104b89:	00 
  104b8a:	89 04 24             	mov    %eax,(%esp)
  104b8d:	e8 0c f9 ff ff       	call   10449e <get_pte>
  104b92:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104b95:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104b99:	75 24                	jne    104bbf <check_pgdir+0x307>
  104b9b:	c7 44 24 0c b0 a0 10 	movl   $0x10a0b0,0xc(%esp)
  104ba2:	00 
  104ba3:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104baa:	00 
  104bab:	c7 44 24 04 15 02 00 	movl   $0x215,0x4(%esp)
  104bb2:	00 
  104bb3:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104bba:	e8 62 b8 ff ff       	call   100421 <__panic>
    assert(*ptep & PTE_U);
  104bbf:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104bc2:	8b 00                	mov    (%eax),%eax
  104bc4:	83 e0 04             	and    $0x4,%eax
  104bc7:	85 c0                	test   %eax,%eax
  104bc9:	75 24                	jne    104bef <check_pgdir+0x337>
  104bcb:	c7 44 24 0c e0 a0 10 	movl   $0x10a0e0,0xc(%esp)
  104bd2:	00 
  104bd3:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104bda:	00 
  104bdb:	c7 44 24 04 16 02 00 	movl   $0x216,0x4(%esp)
  104be2:	00 
  104be3:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104bea:	e8 32 b8 ff ff       	call   100421 <__panic>
    assert(*ptep & PTE_W);
  104bef:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104bf2:	8b 00                	mov    (%eax),%eax
  104bf4:	83 e0 02             	and    $0x2,%eax
  104bf7:	85 c0                	test   %eax,%eax
  104bf9:	75 24                	jne    104c1f <check_pgdir+0x367>
  104bfb:	c7 44 24 0c ee a0 10 	movl   $0x10a0ee,0xc(%esp)
  104c02:	00 
  104c03:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104c0a:	00 
  104c0b:	c7 44 24 04 17 02 00 	movl   $0x217,0x4(%esp)
  104c12:	00 
  104c13:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104c1a:	e8 02 b8 ff ff       	call   100421 <__panic>
    assert(boot_pgdir[0] & PTE_U);
  104c1f:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104c24:	8b 00                	mov    (%eax),%eax
  104c26:	83 e0 04             	and    $0x4,%eax
  104c29:	85 c0                	test   %eax,%eax
  104c2b:	75 24                	jne    104c51 <check_pgdir+0x399>
  104c2d:	c7 44 24 0c fc a0 10 	movl   $0x10a0fc,0xc(%esp)
  104c34:	00 
  104c35:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104c3c:	00 
  104c3d:	c7 44 24 04 18 02 00 	movl   $0x218,0x4(%esp)
  104c44:	00 
  104c45:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104c4c:	e8 d0 b7 ff ff       	call   100421 <__panic>
    assert(page_ref(p2) == 1);
  104c51:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104c54:	89 04 24             	mov    %eax,(%esp)
  104c57:	e8 65 ef ff ff       	call   103bc1 <page_ref>
  104c5c:	83 f8 01             	cmp    $0x1,%eax
  104c5f:	74 24                	je     104c85 <check_pgdir+0x3cd>
  104c61:	c7 44 24 0c 12 a1 10 	movl   $0x10a112,0xc(%esp)
  104c68:	00 
  104c69:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104c70:	00 
  104c71:	c7 44 24 04 19 02 00 	movl   $0x219,0x4(%esp)
  104c78:	00 
  104c79:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104c80:	e8 9c b7 ff ff       	call   100421 <__panic>

    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
  104c85:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104c8a:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  104c91:	00 
  104c92:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104c99:	00 
  104c9a:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104c9d:	89 54 24 04          	mov    %edx,0x4(%esp)
  104ca1:	89 04 24             	mov    %eax,(%esp)
  104ca4:	e8 ce fa ff ff       	call   104777 <page_insert>
  104ca9:	85 c0                	test   %eax,%eax
  104cab:	74 24                	je     104cd1 <check_pgdir+0x419>
  104cad:	c7 44 24 0c 24 a1 10 	movl   $0x10a124,0xc(%esp)
  104cb4:	00 
  104cb5:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104cbc:	00 
  104cbd:	c7 44 24 04 1b 02 00 	movl   $0x21b,0x4(%esp)
  104cc4:	00 
  104cc5:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104ccc:	e8 50 b7 ff ff       	call   100421 <__panic>
    assert(page_ref(p1) == 2);
  104cd1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104cd4:	89 04 24             	mov    %eax,(%esp)
  104cd7:	e8 e5 ee ff ff       	call   103bc1 <page_ref>
  104cdc:	83 f8 02             	cmp    $0x2,%eax
  104cdf:	74 24                	je     104d05 <check_pgdir+0x44d>
  104ce1:	c7 44 24 0c 50 a1 10 	movl   $0x10a150,0xc(%esp)
  104ce8:	00 
  104ce9:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104cf0:	00 
  104cf1:	c7 44 24 04 1c 02 00 	movl   $0x21c,0x4(%esp)
  104cf8:	00 
  104cf9:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104d00:	e8 1c b7 ff ff       	call   100421 <__panic>
    assert(page_ref(p2) == 0);
  104d05:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104d08:	89 04 24             	mov    %eax,(%esp)
  104d0b:	e8 b1 ee ff ff       	call   103bc1 <page_ref>
  104d10:	85 c0                	test   %eax,%eax
  104d12:	74 24                	je     104d38 <check_pgdir+0x480>
  104d14:	c7 44 24 0c 62 a1 10 	movl   $0x10a162,0xc(%esp)
  104d1b:	00 
  104d1c:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104d23:	00 
  104d24:	c7 44 24 04 1d 02 00 	movl   $0x21d,0x4(%esp)
  104d2b:	00 
  104d2c:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104d33:	e8 e9 b6 ff ff       	call   100421 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
  104d38:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104d3d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104d44:	00 
  104d45:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104d4c:	00 
  104d4d:	89 04 24             	mov    %eax,(%esp)
  104d50:	e8 49 f7 ff ff       	call   10449e <get_pte>
  104d55:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104d58:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104d5c:	75 24                	jne    104d82 <check_pgdir+0x4ca>
  104d5e:	c7 44 24 0c b0 a0 10 	movl   $0x10a0b0,0xc(%esp)
  104d65:	00 
  104d66:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104d6d:	00 
  104d6e:	c7 44 24 04 1e 02 00 	movl   $0x21e,0x4(%esp)
  104d75:	00 
  104d76:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104d7d:	e8 9f b6 ff ff       	call   100421 <__panic>
    assert(pte2page(*ptep) == p1);
  104d82:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104d85:	8b 00                	mov    (%eax),%eax
  104d87:	89 04 24             	mov    %eax,(%esp)
  104d8a:	e8 dc ed ff ff       	call   103b6b <pte2page>
  104d8f:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  104d92:	74 24                	je     104db8 <check_pgdir+0x500>
  104d94:	c7 44 24 0c 25 a0 10 	movl   $0x10a025,0xc(%esp)
  104d9b:	00 
  104d9c:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104da3:	00 
  104da4:	c7 44 24 04 1f 02 00 	movl   $0x21f,0x4(%esp)
  104dab:	00 
  104dac:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104db3:	e8 69 b6 ff ff       	call   100421 <__panic>
    assert((*ptep & PTE_U) == 0);
  104db8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104dbb:	8b 00                	mov    (%eax),%eax
  104dbd:	83 e0 04             	and    $0x4,%eax
  104dc0:	85 c0                	test   %eax,%eax
  104dc2:	74 24                	je     104de8 <check_pgdir+0x530>
  104dc4:	c7 44 24 0c 74 a1 10 	movl   $0x10a174,0xc(%esp)
  104dcb:	00 
  104dcc:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104dd3:	00 
  104dd4:	c7 44 24 04 20 02 00 	movl   $0x220,0x4(%esp)
  104ddb:	00 
  104ddc:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104de3:	e8 39 b6 ff ff       	call   100421 <__panic>

    page_remove(boot_pgdir, 0x0);
  104de8:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104ded:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104df4:	00 
  104df5:	89 04 24             	mov    %eax,(%esp)
  104df8:	e8 31 f9 ff ff       	call   10472e <page_remove>
    assert(page_ref(p1) == 1);
  104dfd:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104e00:	89 04 24             	mov    %eax,(%esp)
  104e03:	e8 b9 ed ff ff       	call   103bc1 <page_ref>
  104e08:	83 f8 01             	cmp    $0x1,%eax
  104e0b:	74 24                	je     104e31 <check_pgdir+0x579>
  104e0d:	c7 44 24 0c 3b a0 10 	movl   $0x10a03b,0xc(%esp)
  104e14:	00 
  104e15:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104e1c:	00 
  104e1d:	c7 44 24 04 23 02 00 	movl   $0x223,0x4(%esp)
  104e24:	00 
  104e25:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104e2c:	e8 f0 b5 ff ff       	call   100421 <__panic>
    assert(page_ref(p2) == 0);
  104e31:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104e34:	89 04 24             	mov    %eax,(%esp)
  104e37:	e8 85 ed ff ff       	call   103bc1 <page_ref>
  104e3c:	85 c0                	test   %eax,%eax
  104e3e:	74 24                	je     104e64 <check_pgdir+0x5ac>
  104e40:	c7 44 24 0c 62 a1 10 	movl   $0x10a162,0xc(%esp)
  104e47:	00 
  104e48:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104e4f:	00 
  104e50:	c7 44 24 04 24 02 00 	movl   $0x224,0x4(%esp)
  104e57:	00 
  104e58:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104e5f:	e8 bd b5 ff ff       	call   100421 <__panic>

    page_remove(boot_pgdir, PGSIZE);
  104e64:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104e69:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104e70:	00 
  104e71:	89 04 24             	mov    %eax,(%esp)
  104e74:	e8 b5 f8 ff ff       	call   10472e <page_remove>
    assert(page_ref(p1) == 0);
  104e79:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104e7c:	89 04 24             	mov    %eax,(%esp)
  104e7f:	e8 3d ed ff ff       	call   103bc1 <page_ref>
  104e84:	85 c0                	test   %eax,%eax
  104e86:	74 24                	je     104eac <check_pgdir+0x5f4>
  104e88:	c7 44 24 0c 89 a1 10 	movl   $0x10a189,0xc(%esp)
  104e8f:	00 
  104e90:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104e97:	00 
  104e98:	c7 44 24 04 27 02 00 	movl   $0x227,0x4(%esp)
  104e9f:	00 
  104ea0:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104ea7:	e8 75 b5 ff ff       	call   100421 <__panic>
    assert(page_ref(p2) == 0);
  104eac:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104eaf:	89 04 24             	mov    %eax,(%esp)
  104eb2:	e8 0a ed ff ff       	call   103bc1 <page_ref>
  104eb7:	85 c0                	test   %eax,%eax
  104eb9:	74 24                	je     104edf <check_pgdir+0x627>
  104ebb:	c7 44 24 0c 62 a1 10 	movl   $0x10a162,0xc(%esp)
  104ec2:	00 
  104ec3:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104eca:	00 
  104ecb:	c7 44 24 04 28 02 00 	movl   $0x228,0x4(%esp)
  104ed2:	00 
  104ed3:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104eda:	e8 42 b5 ff ff       	call   100421 <__panic>

    assert(page_ref(pde2page(boot_pgdir[0])) == 1);
  104edf:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104ee4:	8b 00                	mov    (%eax),%eax
  104ee6:	89 04 24             	mov    %eax,(%esp)
  104ee9:	e8 bb ec ff ff       	call   103ba9 <pde2page>
  104eee:	89 04 24             	mov    %eax,(%esp)
  104ef1:	e8 cb ec ff ff       	call   103bc1 <page_ref>
  104ef6:	83 f8 01             	cmp    $0x1,%eax
  104ef9:	74 24                	je     104f1f <check_pgdir+0x667>
  104efb:	c7 44 24 0c 9c a1 10 	movl   $0x10a19c,0xc(%esp)
  104f02:	00 
  104f03:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104f0a:	00 
  104f0b:	c7 44 24 04 2a 02 00 	movl   $0x22a,0x4(%esp)
  104f12:	00 
  104f13:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104f1a:	e8 02 b5 ff ff       	call   100421 <__panic>
    free_page(pde2page(boot_pgdir[0]));
  104f1f:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104f24:	8b 00                	mov    (%eax),%eax
  104f26:	89 04 24             	mov    %eax,(%esp)
  104f29:	e8 7b ec ff ff       	call   103ba9 <pde2page>
  104f2e:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104f35:	00 
  104f36:	89 04 24             	mov    %eax,(%esp)
  104f39:	e8 d5 ee ff ff       	call   103e13 <free_pages>
    boot_pgdir[0] = 0;
  104f3e:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104f43:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
  104f49:	c7 04 24 c3 a1 10 00 	movl   $0x10a1c3,(%esp)
  104f50:	e8 60 b3 ff ff       	call   1002b5 <cprintf>
}
  104f55:	90                   	nop
  104f56:	c9                   	leave  
  104f57:	c3                   	ret    

00104f58 <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
  104f58:	f3 0f 1e fb          	endbr32 
  104f5c:	55                   	push   %ebp
  104f5d:	89 e5                	mov    %esp,%ebp
  104f5f:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
  104f62:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  104f69:	e9 ca 00 00 00       	jmp    105038 <check_boot_pgdir+0xe0>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
  104f6e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104f71:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  104f74:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104f77:	c1 e8 0c             	shr    $0xc,%eax
  104f7a:	89 45 e0             	mov    %eax,-0x20(%ebp)
  104f7d:	a1 80 6e 12 00       	mov    0x126e80,%eax
  104f82:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  104f85:	72 23                	jb     104faa <check_boot_pgdir+0x52>
  104f87:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104f8a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104f8e:	c7 44 24 08 08 9e 10 	movl   $0x109e08,0x8(%esp)
  104f95:	00 
  104f96:	c7 44 24 04 36 02 00 	movl   $0x236,0x4(%esp)
  104f9d:	00 
  104f9e:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104fa5:	e8 77 b4 ff ff       	call   100421 <__panic>
  104faa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104fad:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104fb2:	89 c2                	mov    %eax,%edx
  104fb4:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  104fb9:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104fc0:	00 
  104fc1:	89 54 24 04          	mov    %edx,0x4(%esp)
  104fc5:	89 04 24             	mov    %eax,(%esp)
  104fc8:	e8 d1 f4 ff ff       	call   10449e <get_pte>
  104fcd:	89 45 dc             	mov    %eax,-0x24(%ebp)
  104fd0:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  104fd4:	75 24                	jne    104ffa <check_boot_pgdir+0xa2>
  104fd6:	c7 44 24 0c e0 a1 10 	movl   $0x10a1e0,0xc(%esp)
  104fdd:	00 
  104fde:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  104fe5:	00 
  104fe6:	c7 44 24 04 36 02 00 	movl   $0x236,0x4(%esp)
  104fed:	00 
  104fee:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  104ff5:	e8 27 b4 ff ff       	call   100421 <__panic>
        assert(PTE_ADDR(*ptep) == i);
  104ffa:	8b 45 dc             	mov    -0x24(%ebp),%eax
  104ffd:	8b 00                	mov    (%eax),%eax
  104fff:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  105004:	89 c2                	mov    %eax,%edx
  105006:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105009:	39 c2                	cmp    %eax,%edx
  10500b:	74 24                	je     105031 <check_boot_pgdir+0xd9>
  10500d:	c7 44 24 0c 1d a2 10 	movl   $0x10a21d,0xc(%esp)
  105014:	00 
  105015:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  10501c:	00 
  10501d:	c7 44 24 04 37 02 00 	movl   $0x237,0x4(%esp)
  105024:	00 
  105025:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  10502c:	e8 f0 b3 ff ff       	call   100421 <__panic>
    for (i = 0; i < npage; i += PGSIZE) {
  105031:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
  105038:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10503b:	a1 80 6e 12 00       	mov    0x126e80,%eax
  105040:	39 c2                	cmp    %eax,%edx
  105042:	0f 82 26 ff ff ff    	jb     104f6e <check_boot_pgdir+0x16>
    }

    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
  105048:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  10504d:	05 ac 0f 00 00       	add    $0xfac,%eax
  105052:	8b 00                	mov    (%eax),%eax
  105054:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  105059:	89 c2                	mov    %eax,%edx
  10505b:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  105060:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105063:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
  10506a:	77 23                	ja     10508f <check_boot_pgdir+0x137>
  10506c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10506f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  105073:	c7 44 24 08 ac 9e 10 	movl   $0x109eac,0x8(%esp)
  10507a:	00 
  10507b:	c7 44 24 04 3a 02 00 	movl   $0x23a,0x4(%esp)
  105082:	00 
  105083:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  10508a:	e8 92 b3 ff ff       	call   100421 <__panic>
  10508f:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105092:	05 00 00 00 40       	add    $0x40000000,%eax
  105097:	39 d0                	cmp    %edx,%eax
  105099:	74 24                	je     1050bf <check_boot_pgdir+0x167>
  10509b:	c7 44 24 0c 34 a2 10 	movl   $0x10a234,0xc(%esp)
  1050a2:	00 
  1050a3:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  1050aa:	00 
  1050ab:	c7 44 24 04 3a 02 00 	movl   $0x23a,0x4(%esp)
  1050b2:	00 
  1050b3:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1050ba:	e8 62 b3 ff ff       	call   100421 <__panic>

    assert(boot_pgdir[0] == 0);
  1050bf:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  1050c4:	8b 00                	mov    (%eax),%eax
  1050c6:	85 c0                	test   %eax,%eax
  1050c8:	74 24                	je     1050ee <check_boot_pgdir+0x196>
  1050ca:	c7 44 24 0c 68 a2 10 	movl   $0x10a268,0xc(%esp)
  1050d1:	00 
  1050d2:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  1050d9:	00 
  1050da:	c7 44 24 04 3c 02 00 	movl   $0x23c,0x4(%esp)
  1050e1:	00 
  1050e2:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1050e9:	e8 33 b3 ff ff       	call   100421 <__panic>

    struct Page *p;
    p = alloc_page();
  1050ee:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1050f5:	e8 dd ec ff ff       	call   103dd7 <alloc_pages>
  1050fa:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
  1050fd:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  105102:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  105109:	00 
  10510a:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
  105111:	00 
  105112:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105115:	89 54 24 04          	mov    %edx,0x4(%esp)
  105119:	89 04 24             	mov    %eax,(%esp)
  10511c:	e8 56 f6 ff ff       	call   104777 <page_insert>
  105121:	85 c0                	test   %eax,%eax
  105123:	74 24                	je     105149 <check_boot_pgdir+0x1f1>
  105125:	c7 44 24 0c 7c a2 10 	movl   $0x10a27c,0xc(%esp)
  10512c:	00 
  10512d:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  105134:	00 
  105135:	c7 44 24 04 40 02 00 	movl   $0x240,0x4(%esp)
  10513c:	00 
  10513d:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  105144:	e8 d8 b2 ff ff       	call   100421 <__panic>
    assert(page_ref(p) == 1);
  105149:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10514c:	89 04 24             	mov    %eax,(%esp)
  10514f:	e8 6d ea ff ff       	call   103bc1 <page_ref>
  105154:	83 f8 01             	cmp    $0x1,%eax
  105157:	74 24                	je     10517d <check_boot_pgdir+0x225>
  105159:	c7 44 24 0c aa a2 10 	movl   $0x10a2aa,0xc(%esp)
  105160:	00 
  105161:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  105168:	00 
  105169:	c7 44 24 04 41 02 00 	movl   $0x241,0x4(%esp)
  105170:	00 
  105171:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  105178:	e8 a4 b2 ff ff       	call   100421 <__panic>
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
  10517d:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  105182:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  105189:	00 
  10518a:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
  105191:	00 
  105192:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105195:	89 54 24 04          	mov    %edx,0x4(%esp)
  105199:	89 04 24             	mov    %eax,(%esp)
  10519c:	e8 d6 f5 ff ff       	call   104777 <page_insert>
  1051a1:	85 c0                	test   %eax,%eax
  1051a3:	74 24                	je     1051c9 <check_boot_pgdir+0x271>
  1051a5:	c7 44 24 0c bc a2 10 	movl   $0x10a2bc,0xc(%esp)
  1051ac:	00 
  1051ad:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  1051b4:	00 
  1051b5:	c7 44 24 04 42 02 00 	movl   $0x242,0x4(%esp)
  1051bc:	00 
  1051bd:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1051c4:	e8 58 b2 ff ff       	call   100421 <__panic>
    assert(page_ref(p) == 2);
  1051c9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1051cc:	89 04 24             	mov    %eax,(%esp)
  1051cf:	e8 ed e9 ff ff       	call   103bc1 <page_ref>
  1051d4:	83 f8 02             	cmp    $0x2,%eax
  1051d7:	74 24                	je     1051fd <check_boot_pgdir+0x2a5>
  1051d9:	c7 44 24 0c f3 a2 10 	movl   $0x10a2f3,0xc(%esp)
  1051e0:	00 
  1051e1:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  1051e8:	00 
  1051e9:	c7 44 24 04 43 02 00 	movl   $0x243,0x4(%esp)
  1051f0:	00 
  1051f1:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  1051f8:	e8 24 b2 ff ff       	call   100421 <__panic>

    const char *str = "ucore: Hello world!!";
  1051fd:	c7 45 e8 04 a3 10 00 	movl   $0x10a304,-0x18(%ebp)
    strcpy((void *)0x100, str);
  105204:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105207:	89 44 24 04          	mov    %eax,0x4(%esp)
  10520b:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  105212:	e8 e3 37 00 00       	call   1089fa <strcpy>
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
  105217:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
  10521e:	00 
  10521f:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  105226:	e8 4d 38 00 00       	call   108a78 <strcmp>
  10522b:	85 c0                	test   %eax,%eax
  10522d:	74 24                	je     105253 <check_boot_pgdir+0x2fb>
  10522f:	c7 44 24 0c 1c a3 10 	movl   $0x10a31c,0xc(%esp)
  105236:	00 
  105237:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  10523e:	00 
  10523f:	c7 44 24 04 47 02 00 	movl   $0x247,0x4(%esp)
  105246:	00 
  105247:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  10524e:	e8 ce b1 ff ff       	call   100421 <__panic>

    *(char *)(page2kva(p) + 0x100) = '\0';
  105253:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105256:	89 04 24             	mov    %eax,(%esp)
  105259:	e8 b9 e8 ff ff       	call   103b17 <page2kva>
  10525e:	05 00 01 00 00       	add    $0x100,%eax
  105263:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);
  105266:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  10526d:	e8 2a 37 00 00       	call   10899c <strlen>
  105272:	85 c0                	test   %eax,%eax
  105274:	74 24                	je     10529a <check_boot_pgdir+0x342>
  105276:	c7 44 24 0c 54 a3 10 	movl   $0x10a354,0xc(%esp)
  10527d:	00 
  10527e:	c7 44 24 08 f5 9e 10 	movl   $0x109ef5,0x8(%esp)
  105285:	00 
  105286:	c7 44 24 04 4a 02 00 	movl   $0x24a,0x4(%esp)
  10528d:	00 
  10528e:	c7 04 24 d0 9e 10 00 	movl   $0x109ed0,(%esp)
  105295:	e8 87 b1 ff ff       	call   100421 <__panic>

    free_page(p);
  10529a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1052a1:	00 
  1052a2:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1052a5:	89 04 24             	mov    %eax,(%esp)
  1052a8:	e8 66 eb ff ff       	call   103e13 <free_pages>
    free_page(pde2page(boot_pgdir[0]));
  1052ad:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  1052b2:	8b 00                	mov    (%eax),%eax
  1052b4:	89 04 24             	mov    %eax,(%esp)
  1052b7:	e8 ed e8 ff ff       	call   103ba9 <pde2page>
  1052bc:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1052c3:	00 
  1052c4:	89 04 24             	mov    %eax,(%esp)
  1052c7:	e8 47 eb ff ff       	call   103e13 <free_pages>
    boot_pgdir[0] = 0;
  1052cc:	a1 e0 39 12 00       	mov    0x1239e0,%eax
  1052d1:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");
  1052d7:	c7 04 24 78 a3 10 00 	movl   $0x10a378,(%esp)
  1052de:	e8 d2 af ff ff       	call   1002b5 <cprintf>
}
  1052e3:	90                   	nop
  1052e4:	c9                   	leave  
  1052e5:	c3                   	ret    

001052e6 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
  1052e6:	f3 0f 1e fb          	endbr32 
  1052ea:	55                   	push   %ebp
  1052eb:	89 e5                	mov    %esp,%ebp
    static char str[4];
    str[0] = (perm & PTE_U) ? 'u' : '-';
  1052ed:	8b 45 08             	mov    0x8(%ebp),%eax
  1052f0:	83 e0 04             	and    $0x4,%eax
  1052f3:	85 c0                	test   %eax,%eax
  1052f5:	74 04                	je     1052fb <perm2str+0x15>
  1052f7:	b0 75                	mov    $0x75,%al
  1052f9:	eb 02                	jmp    1052fd <perm2str+0x17>
  1052fb:	b0 2d                	mov    $0x2d,%al
  1052fd:	a2 08 6f 12 00       	mov    %al,0x126f08
    str[1] = 'r';
  105302:	c6 05 09 6f 12 00 72 	movb   $0x72,0x126f09
    str[2] = (perm & PTE_W) ? 'w' : '-';
  105309:	8b 45 08             	mov    0x8(%ebp),%eax
  10530c:	83 e0 02             	and    $0x2,%eax
  10530f:	85 c0                	test   %eax,%eax
  105311:	74 04                	je     105317 <perm2str+0x31>
  105313:	b0 77                	mov    $0x77,%al
  105315:	eb 02                	jmp    105319 <perm2str+0x33>
  105317:	b0 2d                	mov    $0x2d,%al
  105319:	a2 0a 6f 12 00       	mov    %al,0x126f0a
    str[3] = '\0';
  10531e:	c6 05 0b 6f 12 00 00 	movb   $0x0,0x126f0b
    return str;
  105325:	b8 08 6f 12 00       	mov    $0x126f08,%eax
}
  10532a:	5d                   	pop    %ebp
  10532b:	c3                   	ret    

0010532c <get_pgtable_items>:
//  table:       the beginning addr of table
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
  10532c:	f3 0f 1e fb          	endbr32 
  105330:	55                   	push   %ebp
  105331:	89 e5                	mov    %esp,%ebp
  105333:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {
  105336:	8b 45 10             	mov    0x10(%ebp),%eax
  105339:	3b 45 0c             	cmp    0xc(%ebp),%eax
  10533c:	72 0d                	jb     10534b <get_pgtable_items+0x1f>
        return 0;
  10533e:	b8 00 00 00 00       	mov    $0x0,%eax
  105343:	e9 98 00 00 00       	jmp    1053e0 <get_pgtable_items+0xb4>
    }
    while (start < right && !(table[start] & PTE_P)) {
        start ++;
  105348:	ff 45 10             	incl   0x10(%ebp)
    while (start < right && !(table[start] & PTE_P)) {
  10534b:	8b 45 10             	mov    0x10(%ebp),%eax
  10534e:	3b 45 0c             	cmp    0xc(%ebp),%eax
  105351:	73 18                	jae    10536b <get_pgtable_items+0x3f>
  105353:	8b 45 10             	mov    0x10(%ebp),%eax
  105356:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  10535d:	8b 45 14             	mov    0x14(%ebp),%eax
  105360:	01 d0                	add    %edx,%eax
  105362:	8b 00                	mov    (%eax),%eax
  105364:	83 e0 01             	and    $0x1,%eax
  105367:	85 c0                	test   %eax,%eax
  105369:	74 dd                	je     105348 <get_pgtable_items+0x1c>
    }
    if (start < right) {
  10536b:	8b 45 10             	mov    0x10(%ebp),%eax
  10536e:	3b 45 0c             	cmp    0xc(%ebp),%eax
  105371:	73 68                	jae    1053db <get_pgtable_items+0xaf>
        if (left_store != NULL) {
  105373:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
  105377:	74 08                	je     105381 <get_pgtable_items+0x55>
            *left_store = start;
  105379:	8b 45 18             	mov    0x18(%ebp),%eax
  10537c:	8b 55 10             	mov    0x10(%ebp),%edx
  10537f:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);
  105381:	8b 45 10             	mov    0x10(%ebp),%eax
  105384:	8d 50 01             	lea    0x1(%eax),%edx
  105387:	89 55 10             	mov    %edx,0x10(%ebp)
  10538a:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  105391:	8b 45 14             	mov    0x14(%ebp),%eax
  105394:	01 d0                	add    %edx,%eax
  105396:	8b 00                	mov    (%eax),%eax
  105398:	83 e0 07             	and    $0x7,%eax
  10539b:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
  10539e:	eb 03                	jmp    1053a3 <get_pgtable_items+0x77>
            start ++;
  1053a0:	ff 45 10             	incl   0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
  1053a3:	8b 45 10             	mov    0x10(%ebp),%eax
  1053a6:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1053a9:	73 1d                	jae    1053c8 <get_pgtable_items+0x9c>
  1053ab:	8b 45 10             	mov    0x10(%ebp),%eax
  1053ae:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  1053b5:	8b 45 14             	mov    0x14(%ebp),%eax
  1053b8:	01 d0                	add    %edx,%eax
  1053ba:	8b 00                	mov    (%eax),%eax
  1053bc:	83 e0 07             	and    $0x7,%eax
  1053bf:	89 c2                	mov    %eax,%edx
  1053c1:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1053c4:	39 c2                	cmp    %eax,%edx
  1053c6:	74 d8                	je     1053a0 <get_pgtable_items+0x74>
        }
        if (right_store != NULL) {
  1053c8:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  1053cc:	74 08                	je     1053d6 <get_pgtable_items+0xaa>
            *right_store = start;
  1053ce:	8b 45 1c             	mov    0x1c(%ebp),%eax
  1053d1:	8b 55 10             	mov    0x10(%ebp),%edx
  1053d4:	89 10                	mov    %edx,(%eax)
        }
        return perm;
  1053d6:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1053d9:	eb 05                	jmp    1053e0 <get_pgtable_items+0xb4>
    }
    return 0;
  1053db:	b8 00 00 00 00       	mov    $0x0,%eax
}
  1053e0:	c9                   	leave  
  1053e1:	c3                   	ret    

001053e2 <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
  1053e2:	f3 0f 1e fb          	endbr32 
  1053e6:	55                   	push   %ebp
  1053e7:	89 e5                	mov    %esp,%ebp
  1053e9:	57                   	push   %edi
  1053ea:	56                   	push   %esi
  1053eb:	53                   	push   %ebx
  1053ec:	83 ec 4c             	sub    $0x4c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
  1053ef:	c7 04 24 98 a3 10 00 	movl   $0x10a398,(%esp)
  1053f6:	e8 ba ae ff ff       	call   1002b5 <cprintf>
    size_t left, right = 0, perm;
  1053fb:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
  105402:	e9 fa 00 00 00       	jmp    105501 <print_pgdir+0x11f>
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
  105407:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10540a:	89 04 24             	mov    %eax,(%esp)
  10540d:	e8 d4 fe ff ff       	call   1052e6 <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
  105412:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  105415:	8b 55 e0             	mov    -0x20(%ebp),%edx
  105418:	29 d1                	sub    %edx,%ecx
  10541a:	89 ca                	mov    %ecx,%edx
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
  10541c:	89 d6                	mov    %edx,%esi
  10541e:	c1 e6 16             	shl    $0x16,%esi
  105421:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105424:	89 d3                	mov    %edx,%ebx
  105426:	c1 e3 16             	shl    $0x16,%ebx
  105429:	8b 55 e0             	mov    -0x20(%ebp),%edx
  10542c:	89 d1                	mov    %edx,%ecx
  10542e:	c1 e1 16             	shl    $0x16,%ecx
  105431:	8b 7d dc             	mov    -0x24(%ebp),%edi
  105434:	8b 55 e0             	mov    -0x20(%ebp),%edx
  105437:	29 d7                	sub    %edx,%edi
  105439:	89 fa                	mov    %edi,%edx
  10543b:	89 44 24 14          	mov    %eax,0x14(%esp)
  10543f:	89 74 24 10          	mov    %esi,0x10(%esp)
  105443:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  105447:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  10544b:	89 54 24 04          	mov    %edx,0x4(%esp)
  10544f:	c7 04 24 c9 a3 10 00 	movl   $0x10a3c9,(%esp)
  105456:	e8 5a ae ff ff       	call   1002b5 <cprintf>
        size_t l, r = left * NPTEENTRY;
  10545b:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10545e:	c1 e0 0a             	shl    $0xa,%eax
  105461:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
  105464:	eb 54                	jmp    1054ba <print_pgdir+0xd8>
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
  105466:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105469:	89 04 24             	mov    %eax,(%esp)
  10546c:	e8 75 fe ff ff       	call   1052e6 <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
  105471:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  105474:	8b 55 d8             	mov    -0x28(%ebp),%edx
  105477:	29 d1                	sub    %edx,%ecx
  105479:	89 ca                	mov    %ecx,%edx
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
  10547b:	89 d6                	mov    %edx,%esi
  10547d:	c1 e6 0c             	shl    $0xc,%esi
  105480:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  105483:	89 d3                	mov    %edx,%ebx
  105485:	c1 e3 0c             	shl    $0xc,%ebx
  105488:	8b 55 d8             	mov    -0x28(%ebp),%edx
  10548b:	89 d1                	mov    %edx,%ecx
  10548d:	c1 e1 0c             	shl    $0xc,%ecx
  105490:	8b 7d d4             	mov    -0x2c(%ebp),%edi
  105493:	8b 55 d8             	mov    -0x28(%ebp),%edx
  105496:	29 d7                	sub    %edx,%edi
  105498:	89 fa                	mov    %edi,%edx
  10549a:	89 44 24 14          	mov    %eax,0x14(%esp)
  10549e:	89 74 24 10          	mov    %esi,0x10(%esp)
  1054a2:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  1054a6:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  1054aa:	89 54 24 04          	mov    %edx,0x4(%esp)
  1054ae:	c7 04 24 e8 a3 10 00 	movl   $0x10a3e8,(%esp)
  1054b5:	e8 fb ad ff ff       	call   1002b5 <cprintf>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
  1054ba:	be 00 00 c0 fa       	mov    $0xfac00000,%esi
  1054bf:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1054c2:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1054c5:	89 d3                	mov    %edx,%ebx
  1054c7:	c1 e3 0a             	shl    $0xa,%ebx
  1054ca:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1054cd:	89 d1                	mov    %edx,%ecx
  1054cf:	c1 e1 0a             	shl    $0xa,%ecx
  1054d2:	8d 55 d4             	lea    -0x2c(%ebp),%edx
  1054d5:	89 54 24 14          	mov    %edx,0x14(%esp)
  1054d9:	8d 55 d8             	lea    -0x28(%ebp),%edx
  1054dc:	89 54 24 10          	mov    %edx,0x10(%esp)
  1054e0:	89 74 24 0c          	mov    %esi,0xc(%esp)
  1054e4:	89 44 24 08          	mov    %eax,0x8(%esp)
  1054e8:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  1054ec:	89 0c 24             	mov    %ecx,(%esp)
  1054ef:	e8 38 fe ff ff       	call   10532c <get_pgtable_items>
  1054f4:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1054f7:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  1054fb:	0f 85 65 ff ff ff    	jne    105466 <print_pgdir+0x84>
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
  105501:	b9 00 b0 fe fa       	mov    $0xfafeb000,%ecx
  105506:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105509:	8d 55 dc             	lea    -0x24(%ebp),%edx
  10550c:	89 54 24 14          	mov    %edx,0x14(%esp)
  105510:	8d 55 e0             	lea    -0x20(%ebp),%edx
  105513:	89 54 24 10          	mov    %edx,0x10(%esp)
  105517:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  10551b:	89 44 24 08          	mov    %eax,0x8(%esp)
  10551f:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
  105526:	00 
  105527:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  10552e:	e8 f9 fd ff ff       	call   10532c <get_pgtable_items>
  105533:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105536:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  10553a:	0f 85 c7 fe ff ff    	jne    105407 <print_pgdir+0x25>
        }
    }
    cprintf("--------------------- END ---------------------\n");
  105540:	c7 04 24 0c a4 10 00 	movl   $0x10a40c,(%esp)
  105547:	e8 69 ad ff ff       	call   1002b5 <cprintf>
}
  10554c:	90                   	nop
  10554d:	83 c4 4c             	add    $0x4c,%esp
  105550:	5b                   	pop    %ebx
  105551:	5e                   	pop    %esi
  105552:	5f                   	pop    %edi
  105553:	5d                   	pop    %ebp
  105554:	c3                   	ret    

00105555 <page2ppn>:
page2ppn(struct Page *page) {
  105555:	55                   	push   %ebp
  105556:	89 e5                	mov    %esp,%ebp
    return page - pages;
  105558:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  10555d:	8b 55 08             	mov    0x8(%ebp),%edx
  105560:	29 c2                	sub    %eax,%edx
  105562:	89 d0                	mov    %edx,%eax
  105564:	c1 f8 02             	sar    $0x2,%eax
  105567:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
  10556d:	5d                   	pop    %ebp
  10556e:	c3                   	ret    

0010556f <page2pa>:
page2pa(struct Page *page) {
  10556f:	55                   	push   %ebp
  105570:	89 e5                	mov    %esp,%ebp
  105572:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  105575:	8b 45 08             	mov    0x8(%ebp),%eax
  105578:	89 04 24             	mov    %eax,(%esp)
  10557b:	e8 d5 ff ff ff       	call   105555 <page2ppn>
  105580:	c1 e0 0c             	shl    $0xc,%eax
}
  105583:	c9                   	leave  
  105584:	c3                   	ret    

00105585 <page2kva>:
page2kva(struct Page *page) {
  105585:	55                   	push   %ebp
  105586:	89 e5                	mov    %esp,%ebp
  105588:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
  10558b:	8b 45 08             	mov    0x8(%ebp),%eax
  10558e:	89 04 24             	mov    %eax,(%esp)
  105591:	e8 d9 ff ff ff       	call   10556f <page2pa>
  105596:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105599:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10559c:	c1 e8 0c             	shr    $0xc,%eax
  10559f:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1055a2:	a1 80 6e 12 00       	mov    0x126e80,%eax
  1055a7:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  1055aa:	72 23                	jb     1055cf <page2kva+0x4a>
  1055ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1055af:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1055b3:	c7 44 24 08 40 a4 10 	movl   $0x10a440,0x8(%esp)
  1055ba:	00 
  1055bb:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
  1055c2:	00 
  1055c3:	c7 04 24 63 a4 10 00 	movl   $0x10a463,(%esp)
  1055ca:	e8 52 ae ff ff       	call   100421 <__panic>
  1055cf:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1055d2:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
  1055d7:	c9                   	leave  
  1055d8:	c3                   	ret    

001055d9 <kmem_sized_index>:
#define TEST_OBJECT_CTVAL 0x22
#define TEST_OBJECT_DTVAL 0x11
static const char *test_object_name = "test";

static int kmem_sized_index(size_t size) 
{
  1055d9:	f3 0f 1e fb          	endbr32 
  1055dd:	55                   	push   %ebp
  1055de:	89 e5                	mov    %esp,%ebp
  1055e0:	83 ec 20             	sub    $0x20,%esp
    // Round up 
    size_t rsize = ROUNDUP(size, 2);
  1055e3:	c7 45 f0 02 00 00 00 	movl   $0x2,-0x10(%ebp)
  1055ea:	8b 55 08             	mov    0x8(%ebp),%edx
  1055ed:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1055f0:	01 d0                	add    %edx,%eax
  1055f2:	48                   	dec    %eax
  1055f3:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1055f6:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1055f9:	ba 00 00 00 00       	mov    $0x0,%edx
  1055fe:	f7 75 f0             	divl   -0x10(%ebp)
  105601:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105604:	29 d0                	sub    %edx,%eax
  105606:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (rsize < SIZED_CACHE_MIN)
  105609:	83 7d fc 0f          	cmpl   $0xf,-0x4(%ebp)
  10560d:	77 07                	ja     105616 <kmem_sized_index+0x3d>
        rsize = SIZED_CACHE_MIN;
  10560f:	c7 45 fc 10 00 00 00 	movl   $0x10,-0x4(%ebp)
    // Find index
    int index = 0;
  105616:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
    for (int t = rsize / 32; t; t /= 2)
  10561d:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105620:	c1 e8 05             	shr    $0x5,%eax
  105623:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105626:	eb 12                	jmp    10563a <kmem_sized_index+0x61>
        index ++;
  105628:	ff 45 f8             	incl   -0x8(%ebp)
    for (int t = rsize / 32; t; t /= 2)
  10562b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10562e:	89 c2                	mov    %eax,%edx
  105630:	c1 ea 1f             	shr    $0x1f,%edx
  105633:	01 d0                	add    %edx,%eax
  105635:	d1 f8                	sar    %eax
  105637:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10563a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10563e:	75 e8                	jne    105628 <kmem_sized_index+0x4f>
    return index;
  105640:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
  105643:	c9                   	leave  
  105644:	c3                   	ret    

00105645 <test_ctor>:

struct test_object {
    char test_member[TEST_OBJECT_LENTH];
};

static void test_ctor(void* objp, struct kmem_cache_t * cachep, size_t size) {
  105645:	f3 0f 1e fb          	endbr32 
  105649:	55                   	push   %ebp
  10564a:	89 e5                	mov    %esp,%ebp
  10564c:	83 ec 10             	sub    $0x10,%esp
    char *p = objp;
  10564f:	8b 45 08             	mov    0x8(%ebp),%eax
  105652:	89 45 f8             	mov    %eax,-0x8(%ebp)
    for (int i = 0; i < size; i++)
  105655:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  10565c:	eb 0e                	jmp    10566c <test_ctor+0x27>
        p[i] = TEST_OBJECT_CTVAL;
  10565e:	8b 55 fc             	mov    -0x4(%ebp),%edx
  105661:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105664:	01 d0                	add    %edx,%eax
  105666:	c6 00 22             	movb   $0x22,(%eax)
    for (int i = 0; i < size; i++)
  105669:	ff 45 fc             	incl   -0x4(%ebp)
  10566c:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10566f:	39 45 10             	cmp    %eax,0x10(%ebp)
  105672:	77 ea                	ja     10565e <test_ctor+0x19>
}
  105674:	90                   	nop
  105675:	90                   	nop
  105676:	c9                   	leave  
  105677:	c3                   	ret    

00105678 <test_dtor>:

static void test_dtor(void* objp, struct kmem_cache_t * cachep, size_t size) {
  105678:	f3 0f 1e fb          	endbr32 
  10567c:	55                   	push   %ebp
  10567d:	89 e5                	mov    %esp,%ebp
  10567f:	83 ec 10             	sub    $0x10,%esp
    char *p = objp;
  105682:	8b 45 08             	mov    0x8(%ebp),%eax
  105685:	89 45 f8             	mov    %eax,-0x8(%ebp)
    for (int i = 0; i < size; i++)
  105688:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  10568f:	eb 0e                	jmp    10569f <test_dtor+0x27>
        p[i] = TEST_OBJECT_DTVAL;
  105691:	8b 55 fc             	mov    -0x4(%ebp),%edx
  105694:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105697:	01 d0                	add    %edx,%eax
  105699:	c6 00 11             	movb   $0x11,(%eax)
    for (int i = 0; i < size; i++)
  10569c:	ff 45 fc             	incl   -0x4(%ebp)
  10569f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1056a2:	39 45 10             	cmp    %eax,0x10(%ebp)
  1056a5:	77 ea                	ja     105691 <test_dtor+0x19>
}
  1056a7:	90                   	nop
  1056a8:	90                   	nop
  1056a9:	c9                   	leave  
  1056aa:	c3                   	ret    

001056ab <list_length>:

static size_t list_length(list_entry_t *listelm) {
  1056ab:	f3 0f 1e fb          	endbr32 
  1056af:	55                   	push   %ebp
  1056b0:	89 e5                	mov    %esp,%ebp
  1056b2:	83 ec 10             	sub    $0x10,%esp
    size_t len = 0;
  1056b5:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    list_entry_t *le = listelm;
  1056bc:	8b 45 08             	mov    0x8(%ebp),%eax
  1056bf:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while ((le = list_next(le)) != listelm)
  1056c2:	eb 03                	jmp    1056c7 <list_length+0x1c>
        len ++;
  1056c4:	ff 45 fc             	incl   -0x4(%ebp)
  1056c7:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1056ca:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1056cd:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1056d0:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != listelm)
  1056d3:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1056d6:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1056d9:	3b 45 08             	cmp    0x8(%ebp),%eax
  1056dc:	75 e6                	jne    1056c4 <list_length+0x19>
    return len;
  1056de:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1056e1:	c9                   	leave  
  1056e2:	c3                   	ret    

001056e3 <kmem_cache_grow>:

static void * kmem_cache_grow(struct kmem_cache_t *cachep) 
{
  1056e3:	f3 0f 1e fb          	endbr32 
  1056e7:	55                   	push   %ebp
  1056e8:	89 e5                	mov    %esp,%ebp
  1056ea:	83 ec 58             	sub    $0x58,%esp
    struct Page *page = alloc_page();
  1056ed:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1056f4:	e8 de e6 ff ff       	call   103dd7 <alloc_pages>
  1056f9:	89 45 ec             	mov    %eax,-0x14(%ebp)
    list_init(&(page->slab_link));
  1056fc:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1056ff:	83 c0 1c             	add    $0x1c,%eax
  105702:	89 45 c0             	mov    %eax,-0x40(%ebp)
    elm->prev = elm->next = elm;
  105705:	8b 45 c0             	mov    -0x40(%ebp),%eax
  105708:	8b 55 c0             	mov    -0x40(%ebp),%edx
  10570b:	89 50 04             	mov    %edx,0x4(%eax)
  10570e:	8b 45 c0             	mov    -0x40(%ebp),%eax
  105711:	8b 50 04             	mov    0x4(%eax),%edx
  105714:	8b 45 c0             	mov    -0x40(%ebp),%eax
  105717:	89 10                	mov    %edx,(%eax)
}
  105719:	90                   	nop
    void *kva = page2kva(page);
  10571a:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10571d:	89 04 24             	mov    %eax,(%esp)
  105720:	e8 60 fe ff ff       	call   105585 <page2kva>
  105725:	89 45 e8             	mov    %eax,-0x18(%ebp)
    page->cachep = cachep;
  105728:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10572b:	8b 55 08             	mov    0x8(%ebp),%edx
  10572e:	89 50 14             	mov    %edx,0x14(%eax)
    page->inuse = page->free = 0;
  105731:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105734:	66 c7 40 1a 00 00    	movw   $0x0,0x1a(%eax)
  10573a:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10573d:	0f b7 50 1a          	movzwl 0x1a(%eax),%edx
  105741:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105744:	66 89 50 18          	mov    %dx,0x18(%eax)
    list_add(&(cachep->slabs_free), &(page->slab_link));
  105748:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10574b:	83 c0 1c             	add    $0x1c,%eax
  10574e:	8b 55 08             	mov    0x8(%ebp),%edx
  105751:	83 c2 10             	add    $0x10,%edx
  105754:	89 55 dc             	mov    %edx,-0x24(%ebp)
  105757:	89 45 d8             	mov    %eax,-0x28(%ebp)
  10575a:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10575d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  105760:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105763:	89 45 d0             	mov    %eax,-0x30(%ebp)
    __list_add(elm, listelm, listelm->next);
  105766:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105769:	8b 40 04             	mov    0x4(%eax),%eax
  10576c:	8b 55 d0             	mov    -0x30(%ebp),%edx
  10576f:	89 55 cc             	mov    %edx,-0x34(%ebp)
  105772:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  105775:	89 55 c8             	mov    %edx,-0x38(%ebp)
  105778:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    prev->next = next->prev = elm;
  10577b:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  10577e:	8b 55 cc             	mov    -0x34(%ebp),%edx
  105781:	89 10                	mov    %edx,(%eax)
  105783:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  105786:	8b 10                	mov    (%eax),%edx
  105788:	8b 45 c8             	mov    -0x38(%ebp),%eax
  10578b:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  10578e:	8b 45 cc             	mov    -0x34(%ebp),%eax
  105791:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  105794:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  105797:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10579a:	8b 55 c8             	mov    -0x38(%ebp),%edx
  10579d:	89 10                	mov    %edx,(%eax)
}
  10579f:	90                   	nop
}
  1057a0:	90                   	nop
}
  1057a1:	90                   	nop

    int16_t *bufctl = kva;
  1057a2:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1057a5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    for (int i = 1; i < cachep->num; i++)
  1057a8:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
  1057af:	eb 1a                	jmp    1057cb <kmem_cache_grow+0xe8>
        bufctl[i-1] = i;
  1057b1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1057b4:	05 ff ff ff 7f       	add    $0x7fffffff,%eax
  1057b9:	8d 14 00             	lea    (%eax,%eax,1),%edx
  1057bc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1057bf:	01 c2                	add    %eax,%edx
  1057c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1057c4:	98                   	cwtl   
  1057c5:	66 89 02             	mov    %ax,(%edx)
    for (int i = 1; i < cachep->num; i++)
  1057c8:	ff 45 f4             	incl   -0xc(%ebp)
  1057cb:	8b 45 08             	mov    0x8(%ebp),%eax
  1057ce:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  1057d2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  1057d5:	7c da                	jl     1057b1 <kmem_cache_grow+0xce>
    bufctl[cachep->num-1] = -1;
  1057d7:	8b 45 08             	mov    0x8(%ebp),%eax
  1057da:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  1057de:	05 ff ff ff 7f       	add    $0x7fffffff,%eax
  1057e3:	8d 14 00             	lea    (%eax,%eax,1),%edx
  1057e6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1057e9:	01 d0                	add    %edx,%eax
  1057eb:	66 c7 00 ff ff       	movw   $0xffff,(%eax)

    void *buf = bufctl + cachep->num;
  1057f0:	8b 45 08             	mov    0x8(%ebp),%eax
  1057f3:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  1057f7:	8d 14 00             	lea    (%eax,%eax,1),%edx
  1057fa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1057fd:	01 d0                	add    %edx,%eax
  1057ff:	89 45 e0             	mov    %eax,-0x20(%ebp)
    if (cachep->ctor) 
  105802:	8b 45 08             	mov    0x8(%ebp),%eax
  105805:	8b 40 1c             	mov    0x1c(%eax),%eax
  105808:	85 c0                	test   %eax,%eax
  10580a:	74 51                	je     10585d <kmem_cache_grow+0x17a>
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
  10580c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10580f:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105812:	eb 2a                	jmp    10583e <kmem_cache_grow+0x15b>
            cachep->ctor(p, cachep, cachep->objsize);
  105814:	8b 45 08             	mov    0x8(%ebp),%eax
  105817:	8b 40 1c             	mov    0x1c(%eax),%eax
  10581a:	8b 55 08             	mov    0x8(%ebp),%edx
  10581d:	0f b7 52 18          	movzwl 0x18(%edx),%edx
  105821:	89 54 24 08          	mov    %edx,0x8(%esp)
  105825:	8b 55 08             	mov    0x8(%ebp),%edx
  105828:	89 54 24 04          	mov    %edx,0x4(%esp)
  10582c:	8b 55 f0             	mov    -0x10(%ebp),%edx
  10582f:	89 14 24             	mov    %edx,(%esp)
  105832:	ff d0                	call   *%eax
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
  105834:	8b 45 08             	mov    0x8(%ebp),%eax
  105837:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  10583b:	01 45 f0             	add    %eax,-0x10(%ebp)
  10583e:	8b 45 08             	mov    0x8(%ebp),%eax
  105841:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  105845:	89 c2                	mov    %eax,%edx
  105847:	8b 45 08             	mov    0x8(%ebp),%eax
  10584a:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  10584e:	0f af c2             	imul   %edx,%eax
  105851:	89 c2                	mov    %eax,%edx
  105853:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105856:	01 d0                	add    %edx,%eax
  105858:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  10585b:	72 b7                	jb     105814 <kmem_cache_grow+0x131>
    return page;
  10585d:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
  105860:	c9                   	leave  
  105861:	c3                   	ret    

00105862 <kmem_slab_destroy>:

static void kmem_slab_destroy(struct kmem_cache_t *cachep, struct Page *slab) 
{
  105862:	f3 0f 1e fb          	endbr32 
  105866:	55                   	push   %ebp
  105867:	89 e5                	mov    %esp,%ebp
  105869:	83 ec 38             	sub    $0x38,%esp
    int16_t *bufctl = page2kva(slab);
  10586c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10586f:	89 04 24             	mov    %eax,(%esp)
  105872:	e8 0e fd ff ff       	call   105585 <page2kva>
  105877:	89 45 f0             	mov    %eax,-0x10(%ebp)
    void *buf = bufctl + cachep->num;
  10587a:	8b 45 08             	mov    0x8(%ebp),%eax
  10587d:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105881:	8d 14 00             	lea    (%eax,%eax,1),%edx
  105884:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105887:	01 d0                	add    %edx,%eax
  105889:	89 45 ec             	mov    %eax,-0x14(%ebp)
    if (cachep->dtor)
  10588c:	8b 45 08             	mov    0x8(%ebp),%eax
  10588f:	8b 40 20             	mov    0x20(%eax),%eax
  105892:	85 c0                	test   %eax,%eax
  105894:	74 51                	je     1058e7 <kmem_slab_destroy+0x85>
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
  105896:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105899:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10589c:	eb 2a                	jmp    1058c8 <kmem_slab_destroy+0x66>
            cachep->dtor(p, cachep, cachep->objsize);
  10589e:	8b 45 08             	mov    0x8(%ebp),%eax
  1058a1:	8b 40 20             	mov    0x20(%eax),%eax
  1058a4:	8b 55 08             	mov    0x8(%ebp),%edx
  1058a7:	0f b7 52 18          	movzwl 0x18(%edx),%edx
  1058ab:	89 54 24 08          	mov    %edx,0x8(%esp)
  1058af:	8b 55 08             	mov    0x8(%ebp),%edx
  1058b2:	89 54 24 04          	mov    %edx,0x4(%esp)
  1058b6:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1058b9:	89 14 24             	mov    %edx,(%esp)
  1058bc:	ff d0                	call   *%eax
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
  1058be:	8b 45 08             	mov    0x8(%ebp),%eax
  1058c1:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  1058c5:	01 45 f4             	add    %eax,-0xc(%ebp)
  1058c8:	8b 45 08             	mov    0x8(%ebp),%eax
  1058cb:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  1058cf:	89 c2                	mov    %eax,%edx
  1058d1:	8b 45 08             	mov    0x8(%ebp),%eax
  1058d4:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  1058d8:	0f af c2             	imul   %edx,%eax
  1058db:	89 c2                	mov    %eax,%edx
  1058dd:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1058e0:	01 d0                	add    %edx,%eax
  1058e2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  1058e5:	72 b7                	jb     10589e <kmem_slab_destroy+0x3c>
    list_del(&(slab->slab_link));
  1058e7:	8b 45 0c             	mov    0xc(%ebp),%eax
  1058ea:	83 c0 1c             	add    $0x1c,%eax
  1058ed:	89 45 e8             	mov    %eax,-0x18(%ebp)
    __list_del(listelm->prev, listelm->next);
  1058f0:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1058f3:	8b 40 04             	mov    0x4(%eax),%eax
  1058f6:	8b 55 e8             	mov    -0x18(%ebp),%edx
  1058f9:	8b 12                	mov    (%edx),%edx
  1058fb:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  1058fe:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
  105901:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105904:	8b 55 e0             	mov    -0x20(%ebp),%edx
  105907:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  10590a:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10590d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105910:	89 10                	mov    %edx,(%eax)
}
  105912:	90                   	nop
}
  105913:	90                   	nop
    free_page(slab);
  105914:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10591b:	00 
  10591c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10591f:	89 04 24             	mov    %eax,(%esp)
  105922:	e8 ec e4 ff ff       	call   103e13 <free_pages>
}
  105927:	90                   	nop
  105928:	c9                   	leave  
  105929:	c3                   	ret    

0010592a <kmem_cache_create>:

struct kmem_cache_t * kmem_cache_create(const char *name, size_t size, void (*ctor)(void*, struct kmem_cache_t *, size_t), void (*dtor)(void*, struct kmem_cache_t *, size_t)) 
{
  10592a:	f3 0f 1e fb          	endbr32 
  10592e:	55                   	push   %ebp
  10592f:	89 e5                	mov    %esp,%ebp
  105931:	83 ec 48             	sub    $0x48,%esp
    assert(size <= (PGSIZE - 2));
  105934:	81 7d 0c fe 0f 00 00 	cmpl   $0xffe,0xc(%ebp)
  10593b:	76 24                	jbe    105961 <kmem_cache_create+0x37>
  10593d:	c7 44 24 0c 82 a4 10 	movl   $0x10a482,0xc(%esp)
  105944:	00 
  105945:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  10594c:	00 
  10594d:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
  105954:	00 
  105955:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  10595c:	e8 c0 aa ff ff       	call   100421 <__panic>
    struct kmem_cache_t *cachep = kmem_cache_alloc(&(cache_cache));
  105961:	c7 04 24 40 6f 12 00 	movl   $0x126f40,(%esp)
  105968:	e8 1a 02 00 00       	call   105b87 <kmem_cache_alloc>
  10596d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (cachep != NULL) {
  105970:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  105974:	0f 84 07 01 00 00    	je     105a81 <kmem_cache_create+0x157>
        cachep->objsize = size;
  10597a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10597d:	0f b7 d0             	movzwl %ax,%edx
  105980:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105983:	66 89 50 18          	mov    %dx,0x18(%eax)
        cachep->num = PGSIZE / (sizeof(int16_t) + size);
  105987:	8b 45 0c             	mov    0xc(%ebp),%eax
  10598a:	8d 48 02             	lea    0x2(%eax),%ecx
  10598d:	b8 00 10 00 00       	mov    $0x1000,%eax
  105992:	ba 00 00 00 00       	mov    $0x0,%edx
  105997:	f7 f1                	div    %ecx
  105999:	0f b7 d0             	movzwl %ax,%edx
  10599c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10599f:	66 89 50 1a          	mov    %dx,0x1a(%eax)
        cachep->ctor = ctor;
  1059a3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1059a6:	8b 55 10             	mov    0x10(%ebp),%edx
  1059a9:	89 50 1c             	mov    %edx,0x1c(%eax)
        cachep->dtor = dtor;
  1059ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1059af:	8b 55 14             	mov    0x14(%ebp),%edx
  1059b2:	89 50 20             	mov    %edx,0x20(%eax)
        memcpy(cachep->name, name, CACHE_NAMELEN);
  1059b5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1059b8:	8d 50 24             	lea    0x24(%eax),%edx
  1059bb:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
  1059c2:	00 
  1059c3:	8b 45 08             	mov    0x8(%ebp),%eax
  1059c6:	89 44 24 04          	mov    %eax,0x4(%esp)
  1059ca:	89 14 24             	mov    %edx,(%esp)
  1059cd:	e8 f6 33 00 00       	call   108dc8 <memcpy>
        list_init(&(cachep->slabs_full));
  1059d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1059d5:	89 45 cc             	mov    %eax,-0x34(%ebp)
    elm->prev = elm->next = elm;
  1059d8:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1059db:	8b 55 cc             	mov    -0x34(%ebp),%edx
  1059de:	89 50 04             	mov    %edx,0x4(%eax)
  1059e1:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1059e4:	8b 50 04             	mov    0x4(%eax),%edx
  1059e7:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1059ea:	89 10                	mov    %edx,(%eax)
}
  1059ec:	90                   	nop
        list_init(&(cachep->slabs_partial));
  1059ed:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1059f0:	83 c0 08             	add    $0x8,%eax
  1059f3:	89 45 d0             	mov    %eax,-0x30(%ebp)
    elm->prev = elm->next = elm;
  1059f6:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1059f9:	8b 55 d0             	mov    -0x30(%ebp),%edx
  1059fc:	89 50 04             	mov    %edx,0x4(%eax)
  1059ff:	8b 45 d0             	mov    -0x30(%ebp),%eax
  105a02:	8b 50 04             	mov    0x4(%eax),%edx
  105a05:	8b 45 d0             	mov    -0x30(%ebp),%eax
  105a08:	89 10                	mov    %edx,(%eax)
}
  105a0a:	90                   	nop
        list_init(&(cachep->slabs_free));
  105a0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105a0e:	83 c0 10             	add    $0x10,%eax
  105a11:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    elm->prev = elm->next = elm;
  105a14:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105a17:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  105a1a:	89 50 04             	mov    %edx,0x4(%eax)
  105a1d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105a20:	8b 50 04             	mov    0x4(%eax),%edx
  105a23:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105a26:	89 10                	mov    %edx,(%eax)
}
  105a28:	90                   	nop
        list_add(&(cache_chain), &(cachep->cache_link));
  105a29:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105a2c:	83 c0 34             	add    $0x34,%eax
  105a2f:	c7 45 f0 20 6f 12 00 	movl   $0x126f20,-0x10(%ebp)
  105a36:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105a39:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105a3c:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105a3f:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105a42:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    __list_add(elm, listelm, listelm->next);
  105a45:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105a48:	8b 40 04             	mov    0x4(%eax),%eax
  105a4b:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105a4e:	89 55 e0             	mov    %edx,-0x20(%ebp)
  105a51:	8b 55 e8             	mov    -0x18(%ebp),%edx
  105a54:	89 55 dc             	mov    %edx,-0x24(%ebp)
  105a57:	89 45 d8             	mov    %eax,-0x28(%ebp)
    prev->next = next->prev = elm;
  105a5a:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105a5d:	8b 55 e0             	mov    -0x20(%ebp),%edx
  105a60:	89 10                	mov    %edx,(%eax)
  105a62:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105a65:	8b 10                	mov    (%eax),%edx
  105a67:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105a6a:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  105a6d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105a70:	8b 55 d8             	mov    -0x28(%ebp),%edx
  105a73:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  105a76:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105a79:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105a7c:	89 10                	mov    %edx,(%eax)
}
  105a7e:	90                   	nop
}
  105a7f:	90                   	nop
}
  105a80:	90                   	nop
    }
    return cachep;
  105a81:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105a84:	c9                   	leave  
  105a85:	c3                   	ret    

00105a86 <kmem_cache_destroy>:


void kmem_cache_destroy(struct kmem_cache_t *cachep) {
  105a86:	f3 0f 1e fb          	endbr32 
  105a8a:	55                   	push   %ebp
  105a8b:	89 e5                	mov    %esp,%ebp
  105a8d:	83 ec 48             	sub    $0x48,%esp
    list_entry_t *head, *le;
    // Destory full slabs
    head = &(cachep->slabs_full);
  105a90:	8b 45 08             	mov    0x8(%ebp),%eax
  105a93:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105a96:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105a99:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return listelm->next;
  105a9c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105a9f:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(head);
  105aa2:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while (le != head) {
  105aa5:	eb 2a                	jmp    105ad1 <kmem_cache_destroy+0x4b>
        list_entry_t *temp = le;
  105aa7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105aaa:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105aad:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105ab0:	89 45 dc             	mov    %eax,-0x24(%ebp)
  105ab3:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105ab6:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
  105ab9:	89 45 f4             	mov    %eax,-0xc(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
  105abc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105abf:	83 e8 1c             	sub    $0x1c,%eax
  105ac2:	89 44 24 04          	mov    %eax,0x4(%esp)
  105ac6:	8b 45 08             	mov    0x8(%ebp),%eax
  105ac9:	89 04 24             	mov    %eax,(%esp)
  105acc:	e8 91 fd ff ff       	call   105862 <kmem_slab_destroy>
    while (le != head) {
  105ad1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105ad4:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  105ad7:	75 ce                	jne    105aa7 <kmem_cache_destroy+0x21>
    }
    // Destory partial slabs 
    head = &(cachep->slabs_partial);
  105ad9:	8b 45 08             	mov    0x8(%ebp),%eax
  105adc:	83 c0 08             	add    $0x8,%eax
  105adf:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105ae2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105ae5:	89 45 d8             	mov    %eax,-0x28(%ebp)
  105ae8:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105aeb:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(head);
  105aee:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while (le != head) {
  105af1:	eb 2a                	jmp    105b1d <kmem_cache_destroy+0x97>
        list_entry_t *temp = le;
  105af3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105af6:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105af9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105afc:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  105aff:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105b02:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
  105b05:	89 45 f4             	mov    %eax,-0xc(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
  105b08:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105b0b:	83 e8 1c             	sub    $0x1c,%eax
  105b0e:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b12:	8b 45 08             	mov    0x8(%ebp),%eax
  105b15:	89 04 24             	mov    %eax,(%esp)
  105b18:	e8 45 fd ff ff       	call   105862 <kmem_slab_destroy>
    while (le != head) {
  105b1d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105b20:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  105b23:	75 ce                	jne    105af3 <kmem_cache_destroy+0x6d>
    }
    // Destory free slabs 
    head = &(cachep->slabs_free);
  105b25:	8b 45 08             	mov    0x8(%ebp),%eax
  105b28:	83 c0 10             	add    $0x10,%eax
  105b2b:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105b2e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105b31:	89 45 d0             	mov    %eax,-0x30(%ebp)
  105b34:	8b 45 d0             	mov    -0x30(%ebp),%eax
  105b37:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(head);
  105b3a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while (le != head) {
  105b3d:	eb 2a                	jmp    105b69 <kmem_cache_destroy+0xe3>
        list_entry_t *temp = le;
  105b3f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105b42:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105b45:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105b48:	89 45 cc             	mov    %eax,-0x34(%ebp)
  105b4b:	8b 45 cc             	mov    -0x34(%ebp),%eax
  105b4e:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
  105b51:	89 45 f4             	mov    %eax,-0xc(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
  105b54:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105b57:	83 e8 1c             	sub    $0x1c,%eax
  105b5a:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b5e:	8b 45 08             	mov    0x8(%ebp),%eax
  105b61:	89 04 24             	mov    %eax,(%esp)
  105b64:	e8 f9 fc ff ff       	call   105862 <kmem_slab_destroy>
    while (le != head) {
  105b69:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105b6c:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  105b6f:	75 ce                	jne    105b3f <kmem_cache_destroy+0xb9>
    }
    // Free kmem_cache 
    kmem_cache_free(&(cache_cache), cachep);
  105b71:	8b 45 08             	mov    0x8(%ebp),%eax
  105b74:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b78:	c7 04 24 40 6f 12 00 	movl   $0x126f40,(%esp)
  105b7f:	e8 f5 01 00 00       	call   105d79 <kmem_cache_free>
}
  105b84:	90                   	nop
  105b85:	c9                   	leave  
  105b86:	c3                   	ret    

00105b87 <kmem_cache_alloc>:

void * kmem_cache_alloc(struct kmem_cache_t *cachep) 
{
  105b87:	f3 0f 1e fb          	endbr32 
  105b8b:	55                   	push   %ebp
  105b8c:	89 e5                	mov    %esp,%ebp
  105b8e:	81 ec 88 00 00 00    	sub    $0x88,%esp
    list_entry_t *le = NULL;
  105b94:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    // Find in partial list 
    if (!list_empty(&(cachep->slabs_partial)))
  105b9b:	8b 45 08             	mov    0x8(%ebp),%eax
  105b9e:	83 c0 08             	add    $0x8,%eax
  105ba1:	89 45 dc             	mov    %eax,-0x24(%ebp)
    return list->next == list;
  105ba4:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105ba7:	8b 40 04             	mov    0x4(%eax),%eax
  105baa:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  105bad:	0f 94 c0             	sete   %al
  105bb0:	0f b6 c0             	movzbl %al,%eax
  105bb3:	85 c0                	test   %eax,%eax
  105bb5:	75 14                	jne    105bcb <kmem_cache_alloc+0x44>
        le = list_next(&(cachep->slabs_partial));
  105bb7:	8b 45 08             	mov    0x8(%ebp),%eax
  105bba:	83 c0 08             	add    $0x8,%eax
  105bbd:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return listelm->next;
  105bc0:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105bc3:	8b 40 04             	mov    0x4(%eax),%eax
  105bc6:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105bc9:	eb 47                	jmp    105c12 <kmem_cache_alloc+0x8b>
    // Find in empty list 
    else 
    {
        if (list_empty(&(cachep->slabs_free)) && kmem_cache_grow(cachep) == NULL)
  105bcb:	8b 45 08             	mov    0x8(%ebp),%eax
  105bce:	83 c0 10             	add    $0x10,%eax
  105bd1:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    return list->next == list;
  105bd4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105bd7:	8b 40 04             	mov    0x4(%eax),%eax
  105bda:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
  105bdd:	0f 94 c0             	sete   %al
  105be0:	0f b6 c0             	movzbl %al,%eax
  105be3:	85 c0                	test   %eax,%eax
  105be5:	74 19                	je     105c00 <kmem_cache_alloc+0x79>
  105be7:	8b 45 08             	mov    0x8(%ebp),%eax
  105bea:	89 04 24             	mov    %eax,(%esp)
  105bed:	e8 f1 fa ff ff       	call   1056e3 <kmem_cache_grow>
  105bf2:	85 c0                	test   %eax,%eax
  105bf4:	75 0a                	jne    105c00 <kmem_cache_alloc+0x79>
            return NULL;
  105bf6:	b8 00 00 00 00       	mov    $0x0,%eax
  105bfb:	e9 77 01 00 00       	jmp    105d77 <kmem_cache_alloc+0x1f0>
        le = list_next(&(cachep->slabs_free));
  105c00:	8b 45 08             	mov    0x8(%ebp),%eax
  105c03:	83 c0 10             	add    $0x10,%eax
  105c06:	89 45 d0             	mov    %eax,-0x30(%ebp)
    return listelm->next;
  105c09:	8b 45 d0             	mov    -0x30(%ebp),%eax
  105c0c:	8b 40 04             	mov    0x4(%eax),%eax
  105c0f:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105c12:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105c15:	89 45 cc             	mov    %eax,-0x34(%ebp)
    __list_del(listelm->prev, listelm->next);
  105c18:	8b 45 cc             	mov    -0x34(%ebp),%eax
  105c1b:	8b 40 04             	mov    0x4(%eax),%eax
  105c1e:	8b 55 cc             	mov    -0x34(%ebp),%edx
  105c21:	8b 12                	mov    (%edx),%edx
  105c23:	89 55 c8             	mov    %edx,-0x38(%ebp)
  105c26:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    prev->next = next;
  105c29:	8b 45 c8             	mov    -0x38(%ebp),%eax
  105c2c:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  105c2f:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  105c32:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  105c35:	8b 55 c8             	mov    -0x38(%ebp),%edx
  105c38:	89 10                	mov    %edx,(%eax)
}
  105c3a:	90                   	nop
}
  105c3b:	90                   	nop
    }
    // Alloc 
    list_del(le);
    struct Page *slab = le2page(le, slab_link);
  105c3c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105c3f:	83 e8 1c             	sub    $0x1c,%eax
  105c42:	89 45 f0             	mov    %eax,-0x10(%ebp)
    void *kva = page2kva(slab);
  105c45:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105c48:	89 04 24             	mov    %eax,(%esp)
  105c4b:	e8 35 f9 ff ff       	call   105585 <page2kva>
  105c50:	89 45 ec             	mov    %eax,-0x14(%ebp)
    int16_t *bufctl = kva;
  105c53:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105c56:	89 45 e8             	mov    %eax,-0x18(%ebp)
    void *buf = bufctl + cachep->num;
  105c59:	8b 45 08             	mov    0x8(%ebp),%eax
  105c5c:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105c60:	8d 14 00             	lea    (%eax,%eax,1),%edx
  105c63:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105c66:	01 d0                	add    %edx,%eax
  105c68:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    void *objp = buf + slab->free * cachep->objsize;
  105c6b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105c6e:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105c72:	89 c2                	mov    %eax,%edx
  105c74:	8b 45 08             	mov    0x8(%ebp),%eax
  105c77:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  105c7b:	0f af c2             	imul   %edx,%eax
  105c7e:	89 c2                	mov    %eax,%edx
  105c80:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105c83:	01 d0                	add    %edx,%eax
  105c85:	89 45 e0             	mov    %eax,-0x20(%ebp)
    // Update slab
    slab->inuse ++;
  105c88:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105c8b:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  105c8f:	40                   	inc    %eax
  105c90:	0f b7 d0             	movzwl %ax,%edx
  105c93:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105c96:	66 89 50 18          	mov    %dx,0x18(%eax)
    slab->free = bufctl[slab->free];
  105c9a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105c9d:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105ca1:	8d 14 00             	lea    (%eax,%eax,1),%edx
  105ca4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105ca7:	01 d0                	add    %edx,%eax
  105ca9:	0f bf 00             	movswl (%eax),%eax
  105cac:	0f b7 d0             	movzwl %ax,%edx
  105caf:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105cb2:	66 89 50 1a          	mov    %dx,0x1a(%eax)
    if (slab->inuse == cachep->num)
  105cb6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105cb9:	0f b7 50 18          	movzwl 0x18(%eax),%edx
  105cbd:	8b 45 08             	mov    0x8(%ebp),%eax
  105cc0:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105cc4:	39 c2                	cmp    %eax,%edx
  105cc6:	75 55                	jne    105d1d <kmem_cache_alloc+0x196>
        list_add(&(cachep->slabs_full), le);
  105cc8:	8b 45 08             	mov    0x8(%ebp),%eax
  105ccb:	89 45 c0             	mov    %eax,-0x40(%ebp)
  105cce:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105cd1:	89 45 bc             	mov    %eax,-0x44(%ebp)
  105cd4:	8b 45 c0             	mov    -0x40(%ebp),%eax
  105cd7:	89 45 b8             	mov    %eax,-0x48(%ebp)
  105cda:	8b 45 bc             	mov    -0x44(%ebp),%eax
  105cdd:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    __list_add(elm, listelm, listelm->next);
  105ce0:	8b 45 b8             	mov    -0x48(%ebp),%eax
  105ce3:	8b 40 04             	mov    0x4(%eax),%eax
  105ce6:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  105ce9:	89 55 b0             	mov    %edx,-0x50(%ebp)
  105cec:	8b 55 b8             	mov    -0x48(%ebp),%edx
  105cef:	89 55 ac             	mov    %edx,-0x54(%ebp)
  105cf2:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next->prev = elm;
  105cf5:	8b 45 a8             	mov    -0x58(%ebp),%eax
  105cf8:	8b 55 b0             	mov    -0x50(%ebp),%edx
  105cfb:	89 10                	mov    %edx,(%eax)
  105cfd:	8b 45 a8             	mov    -0x58(%ebp),%eax
  105d00:	8b 10                	mov    (%eax),%edx
  105d02:	8b 45 ac             	mov    -0x54(%ebp),%eax
  105d05:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  105d08:	8b 45 b0             	mov    -0x50(%ebp),%eax
  105d0b:	8b 55 a8             	mov    -0x58(%ebp),%edx
  105d0e:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  105d11:	8b 45 b0             	mov    -0x50(%ebp),%eax
  105d14:	8b 55 ac             	mov    -0x54(%ebp),%edx
  105d17:	89 10                	mov    %edx,(%eax)
}
  105d19:	90                   	nop
}
  105d1a:	90                   	nop
}
  105d1b:	eb 57                	jmp    105d74 <kmem_cache_alloc+0x1ed>
    else 
        list_add(&(cachep->slabs_partial), le);
  105d1d:	8b 45 08             	mov    0x8(%ebp),%eax
  105d20:	83 c0 08             	add    $0x8,%eax
  105d23:	89 45 a4             	mov    %eax,-0x5c(%ebp)
  105d26:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105d29:	89 45 a0             	mov    %eax,-0x60(%ebp)
  105d2c:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  105d2f:	89 45 9c             	mov    %eax,-0x64(%ebp)
  105d32:	8b 45 a0             	mov    -0x60(%ebp),%eax
  105d35:	89 45 98             	mov    %eax,-0x68(%ebp)
    __list_add(elm, listelm, listelm->next);
  105d38:	8b 45 9c             	mov    -0x64(%ebp),%eax
  105d3b:	8b 40 04             	mov    0x4(%eax),%eax
  105d3e:	8b 55 98             	mov    -0x68(%ebp),%edx
  105d41:	89 55 94             	mov    %edx,-0x6c(%ebp)
  105d44:	8b 55 9c             	mov    -0x64(%ebp),%edx
  105d47:	89 55 90             	mov    %edx,-0x70(%ebp)
  105d4a:	89 45 8c             	mov    %eax,-0x74(%ebp)
    prev->next = next->prev = elm;
  105d4d:	8b 45 8c             	mov    -0x74(%ebp),%eax
  105d50:	8b 55 94             	mov    -0x6c(%ebp),%edx
  105d53:	89 10                	mov    %edx,(%eax)
  105d55:	8b 45 8c             	mov    -0x74(%ebp),%eax
  105d58:	8b 10                	mov    (%eax),%edx
  105d5a:	8b 45 90             	mov    -0x70(%ebp),%eax
  105d5d:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  105d60:	8b 45 94             	mov    -0x6c(%ebp),%eax
  105d63:	8b 55 8c             	mov    -0x74(%ebp),%edx
  105d66:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  105d69:	8b 45 94             	mov    -0x6c(%ebp),%eax
  105d6c:	8b 55 90             	mov    -0x70(%ebp),%edx
  105d6f:	89 10                	mov    %edx,(%eax)
}
  105d71:	90                   	nop
}
  105d72:	90                   	nop
}
  105d73:	90                   	nop
    return objp;
  105d74:	8b 45 e0             	mov    -0x20(%ebp),%eax
}
  105d77:	c9                   	leave  
  105d78:	c3                   	ret    

00105d79 <kmem_cache_free>:

void kmem_cache_free(struct kmem_cache_t *cachep, void *objp) 
{
  105d79:	f3 0f 1e fb          	endbr32 
  105d7d:	55                   	push   %ebp
  105d7e:	89 e5                	mov    %esp,%ebp
  105d80:	83 ec 78             	sub    $0x78,%esp
    // Get slab of object 
    void *base = page2kva(pages);
  105d83:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  105d88:	89 04 24             	mov    %eax,(%esp)
  105d8b:	e8 f5 f7 ff ff       	call   105585 <page2kva>
  105d90:	89 45 f4             	mov    %eax,-0xc(%ebp)
    void *kva = ROUNDDOWN(objp, PGSIZE);
  105d93:	8b 45 0c             	mov    0xc(%ebp),%eax
  105d96:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105d99:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105d9c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  105da1:	89 45 ec             	mov    %eax,-0x14(%ebp)
    struct Page *slab =  &pages[(kva-base)/PGSIZE];
  105da4:	8b 0d 08 da 2a 00    	mov    0x2ada08,%ecx
  105daa:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105dad:	2b 45 f4             	sub    -0xc(%ebp),%eax
  105db0:	8d 90 ff 0f 00 00    	lea    0xfff(%eax),%edx
  105db6:	85 c0                	test   %eax,%eax
  105db8:	0f 48 c2             	cmovs  %edx,%eax
  105dbb:	c1 f8 0c             	sar    $0xc,%eax
  105dbe:	89 c2                	mov    %eax,%edx
  105dc0:	89 d0                	mov    %edx,%eax
  105dc2:	c1 e0 03             	shl    $0x3,%eax
  105dc5:	01 d0                	add    %edx,%eax
  105dc7:	c1 e0 02             	shl    $0x2,%eax
  105dca:	01 c8                	add    %ecx,%eax
  105dcc:	89 45 e8             	mov    %eax,-0x18(%ebp)
    // Get offset in slab
    int16_t *bufctl = kva;
  105dcf:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105dd2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    void *buf = bufctl + cachep->num;
  105dd5:	8b 45 08             	mov    0x8(%ebp),%eax
  105dd8:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105ddc:	8d 14 00             	lea    (%eax,%eax,1),%edx
  105ddf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105de2:	01 d0                	add    %edx,%eax
  105de4:	89 45 e0             	mov    %eax,-0x20(%ebp)
    int offset = (objp - buf) / cachep->objsize;
  105de7:	8b 45 0c             	mov    0xc(%ebp),%eax
  105dea:	2b 45 e0             	sub    -0x20(%ebp),%eax
  105ded:	8b 55 08             	mov    0x8(%ebp),%edx
  105df0:	0f b7 52 18          	movzwl 0x18(%edx),%edx
  105df4:	89 d1                	mov    %edx,%ecx
  105df6:	99                   	cltd   
  105df7:	f7 f9                	idiv   %ecx
  105df9:	89 45 dc             	mov    %eax,-0x24(%ebp)
    // Update slab 
    list_del(&(slab->slab_link));
  105dfc:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105dff:	83 c0 1c             	add    $0x1c,%eax
  105e02:	89 45 d8             	mov    %eax,-0x28(%ebp)
    __list_del(listelm->prev, listelm->next);
  105e05:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105e08:	8b 40 04             	mov    0x4(%eax),%eax
  105e0b:	8b 55 d8             	mov    -0x28(%ebp),%edx
  105e0e:	8b 12                	mov    (%edx),%edx
  105e10:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  105e13:	89 45 d0             	mov    %eax,-0x30(%ebp)
    prev->next = next;
  105e16:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  105e19:	8b 55 d0             	mov    -0x30(%ebp),%edx
  105e1c:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  105e1f:	8b 45 d0             	mov    -0x30(%ebp),%eax
  105e22:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  105e25:	89 10                	mov    %edx,(%eax)
}
  105e27:	90                   	nop
}
  105e28:	90                   	nop
    bufctl[offset] = slab->free;
  105e29:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105e2c:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
  105e30:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105e33:	8d 0c 12             	lea    (%edx,%edx,1),%ecx
  105e36:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105e39:	01 ca                	add    %ecx,%edx
  105e3b:	98                   	cwtl   
  105e3c:	66 89 02             	mov    %ax,(%edx)
    slab->inuse --;
  105e3f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105e42:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  105e46:	48                   	dec    %eax
  105e47:	0f b7 d0             	movzwl %ax,%edx
  105e4a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105e4d:	66 89 50 18          	mov    %dx,0x18(%eax)
    slab->free = offset;
  105e51:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105e54:	0f b7 d0             	movzwl %ax,%edx
  105e57:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105e5a:	66 89 50 1a          	mov    %dx,0x1a(%eax)
    if (slab->inuse == 0)
  105e5e:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105e61:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  105e65:	85 c0                	test   %eax,%eax
  105e67:	75 5b                	jne    105ec4 <kmem_cache_free+0x14b>
        list_add(&(cachep->slabs_free), &(slab->slab_link));
  105e69:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105e6c:	83 c0 1c             	add    $0x1c,%eax
  105e6f:	8b 55 08             	mov    0x8(%ebp),%edx
  105e72:	83 c2 10             	add    $0x10,%edx
  105e75:	89 55 cc             	mov    %edx,-0x34(%ebp)
  105e78:	89 45 c8             	mov    %eax,-0x38(%ebp)
  105e7b:	8b 45 cc             	mov    -0x34(%ebp),%eax
  105e7e:	89 45 c4             	mov    %eax,-0x3c(%ebp)
  105e81:	8b 45 c8             	mov    -0x38(%ebp),%eax
  105e84:	89 45 c0             	mov    %eax,-0x40(%ebp)
    __list_add(elm, listelm, listelm->next);
  105e87:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  105e8a:	8b 40 04             	mov    0x4(%eax),%eax
  105e8d:	8b 55 c0             	mov    -0x40(%ebp),%edx
  105e90:	89 55 bc             	mov    %edx,-0x44(%ebp)
  105e93:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  105e96:	89 55 b8             	mov    %edx,-0x48(%ebp)
  105e99:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    prev->next = next->prev = elm;
  105e9c:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  105e9f:	8b 55 bc             	mov    -0x44(%ebp),%edx
  105ea2:	89 10                	mov    %edx,(%eax)
  105ea4:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  105ea7:	8b 10                	mov    (%eax),%edx
  105ea9:	8b 45 b8             	mov    -0x48(%ebp),%eax
  105eac:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  105eaf:	8b 45 bc             	mov    -0x44(%ebp),%eax
  105eb2:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  105eb5:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  105eb8:	8b 45 bc             	mov    -0x44(%ebp),%eax
  105ebb:	8b 55 b8             	mov    -0x48(%ebp),%edx
  105ebe:	89 10                	mov    %edx,(%eax)
}
  105ec0:	90                   	nop
}
  105ec1:	90                   	nop
}
  105ec2:	eb 5a                	jmp    105f1e <kmem_cache_free+0x1a5>
    else 
        list_add(&(cachep->slabs_partial), &(slab->slab_link));
  105ec4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105ec7:	83 c0 1c             	add    $0x1c,%eax
  105eca:	8b 55 08             	mov    0x8(%ebp),%edx
  105ecd:	83 c2 08             	add    $0x8,%edx
  105ed0:	89 55 b0             	mov    %edx,-0x50(%ebp)
  105ed3:	89 45 ac             	mov    %eax,-0x54(%ebp)
  105ed6:	8b 45 b0             	mov    -0x50(%ebp),%eax
  105ed9:	89 45 a8             	mov    %eax,-0x58(%ebp)
  105edc:	8b 45 ac             	mov    -0x54(%ebp),%eax
  105edf:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    __list_add(elm, listelm, listelm->next);
  105ee2:	8b 45 a8             	mov    -0x58(%ebp),%eax
  105ee5:	8b 40 04             	mov    0x4(%eax),%eax
  105ee8:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  105eeb:	89 55 a0             	mov    %edx,-0x60(%ebp)
  105eee:	8b 55 a8             	mov    -0x58(%ebp),%edx
  105ef1:	89 55 9c             	mov    %edx,-0x64(%ebp)
  105ef4:	89 45 98             	mov    %eax,-0x68(%ebp)
    prev->next = next->prev = elm;
  105ef7:	8b 45 98             	mov    -0x68(%ebp),%eax
  105efa:	8b 55 a0             	mov    -0x60(%ebp),%edx
  105efd:	89 10                	mov    %edx,(%eax)
  105eff:	8b 45 98             	mov    -0x68(%ebp),%eax
  105f02:	8b 10                	mov    (%eax),%edx
  105f04:	8b 45 9c             	mov    -0x64(%ebp),%eax
  105f07:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  105f0a:	8b 45 a0             	mov    -0x60(%ebp),%eax
  105f0d:	8b 55 98             	mov    -0x68(%ebp),%edx
  105f10:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  105f13:	8b 45 a0             	mov    -0x60(%ebp),%eax
  105f16:	8b 55 9c             	mov    -0x64(%ebp),%edx
  105f19:	89 10                	mov    %edx,(%eax)
}
  105f1b:	90                   	nop
}
  105f1c:	90                   	nop
}
  105f1d:	90                   	nop
}
  105f1e:	90                   	nop
  105f1f:	c9                   	leave  
  105f20:	c3                   	ret    

00105f21 <kmem_cache_size>:

size_t kmem_cache_size(struct kmem_cache_t *cachep) 
{
  105f21:	f3 0f 1e fb          	endbr32 
  105f25:	55                   	push   %ebp
  105f26:	89 e5                	mov    %esp,%ebp
    return cachep->objsize;
  105f28:	8b 45 08             	mov    0x8(%ebp),%eax
  105f2b:	0f b7 40 18          	movzwl 0x18(%eax),%eax
}
  105f2f:	5d                   	pop    %ebp
  105f30:	c3                   	ret    

00105f31 <kmem_cache_name>:

// kmem_cache_name - get cache name
const char * kmem_cache_name(struct kmem_cache_t *cachep) 
{
  105f31:	f3 0f 1e fb          	endbr32 
  105f35:	55                   	push   %ebp
  105f36:	89 e5                	mov    %esp,%ebp
    return cachep->name;
  105f38:	8b 45 08             	mov    0x8(%ebp),%eax
  105f3b:	83 c0 24             	add    $0x24,%eax
}
  105f3e:	5d                   	pop    %ebp
  105f3f:	c3                   	ret    

00105f40 <kmem_cache_shrink>:

int kmem_cache_shrink(struct kmem_cache_t *cachep) 
{
  105f40:	f3 0f 1e fb          	endbr32 
  105f44:	55                   	push   %ebp
  105f45:	89 e5                	mov    %esp,%ebp
  105f47:	83 ec 38             	sub    $0x38,%esp
    int count = 0;
  105f4a:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = list_next(&(cachep->slabs_free));
  105f51:	8b 45 08             	mov    0x8(%ebp),%eax
  105f54:	83 c0 10             	add    $0x10,%eax
  105f57:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return listelm->next;
  105f5a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105f5d:	8b 40 04             	mov    0x4(%eax),%eax
  105f60:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &(cachep->slabs_free)) {
  105f63:	eb 2d                	jmp    105f92 <kmem_cache_shrink+0x52>
        list_entry_t *temp = le;
  105f65:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105f68:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105f6b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105f6e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105f71:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105f74:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
  105f77:	89 45 f0             	mov    %eax,-0x10(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
  105f7a:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105f7d:	83 e8 1c             	sub    $0x1c,%eax
  105f80:	89 44 24 04          	mov    %eax,0x4(%esp)
  105f84:	8b 45 08             	mov    0x8(%ebp),%eax
  105f87:	89 04 24             	mov    %eax,(%esp)
  105f8a:	e8 d3 f8 ff ff       	call   105862 <kmem_slab_destroy>
        count ++;
  105f8f:	ff 45 f4             	incl   -0xc(%ebp)
    while (le != &(cachep->slabs_free)) {
  105f92:	8b 45 08             	mov    0x8(%ebp),%eax
  105f95:	83 c0 10             	add    $0x10,%eax
  105f98:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  105f9b:	75 c8                	jne    105f65 <kmem_cache_shrink+0x25>
    }
    return count;
  105f9d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105fa0:	c9                   	leave  
  105fa1:	c3                   	ret    

00105fa2 <kmem_cache_reap>:

int kmem_cache_reap() 
{
  105fa2:	f3 0f 1e fb          	endbr32 
  105fa6:	55                   	push   %ebp
  105fa7:	89 e5                	mov    %esp,%ebp
  105fa9:	83 ec 28             	sub    $0x28,%esp
    int count = 0;
  105fac:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &(cache_chain);
  105fb3:	c7 45 f0 20 6f 12 00 	movl   $0x126f20,-0x10(%ebp)
    while ((le = list_next(le)) != &(cache_chain))
  105fba:	eb 11                	jmp    105fcd <kmem_cache_reap+0x2b>
        count += kmem_cache_shrink(to_struct(le, struct kmem_cache_t, cache_link));
  105fbc:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105fbf:	83 e8 34             	sub    $0x34,%eax
  105fc2:	89 04 24             	mov    %eax,(%esp)
  105fc5:	e8 76 ff ff ff       	call   105f40 <kmem_cache_shrink>
  105fca:	01 45 f4             	add    %eax,-0xc(%ebp)
  105fcd:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105fd0:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105fd3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105fd6:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &(cache_chain))
  105fd9:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105fdc:	81 7d f0 20 6f 12 00 	cmpl   $0x126f20,-0x10(%ebp)
  105fe3:	75 d7                	jne    105fbc <kmem_cache_reap+0x1a>
    return count;
  105fe5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105fe8:	c9                   	leave  
  105fe9:	c3                   	ret    

00105fea <kmalloc>:


void * kmalloc(size_t size) 
{
  105fea:	f3 0f 1e fb          	endbr32 
  105fee:	55                   	push   %ebp
  105fef:	89 e5                	mov    %esp,%ebp
  105ff1:	83 ec 18             	sub    $0x18,%esp
    assert(size <= SIZED_CACHE_MAX);
  105ff4:	81 7d 08 00 08 00 00 	cmpl   $0x800,0x8(%ebp)
  105ffb:	76 24                	jbe    106021 <kmalloc+0x37>
  105ffd:	c7 44 24 0c bb a4 10 	movl   $0x10a4bb,0xc(%esp)
  106004:	00 
  106005:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  10600c:	00 
  10600d:	c7 44 24 04 e7 00 00 	movl   $0xe7,0x4(%esp)
  106014:	00 
  106015:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  10601c:	e8 00 a4 ff ff       	call   100421 <__panic>
    return kmem_cache_alloc(sized_caches[kmem_sized_index(size)]);
  106021:	8b 45 08             	mov    0x8(%ebp),%eax
  106024:	89 04 24             	mov    %eax,(%esp)
  106027:	e8 ad f5 ff ff       	call   1055d9 <kmem_sized_index>
  10602c:	8b 04 85 80 6f 12 00 	mov    0x126f80(,%eax,4),%eax
  106033:	89 04 24             	mov    %eax,(%esp)
  106036:	e8 4c fb ff ff       	call   105b87 <kmem_cache_alloc>
}
  10603b:	c9                   	leave  
  10603c:	c3                   	ret    

0010603d <kmem_cache_zalloc>:
void * kmem_cache_zalloc(struct kmem_cache_t *cachep) 
{
  10603d:	f3 0f 1e fb          	endbr32 
  106041:	55                   	push   %ebp
  106042:	89 e5                	mov    %esp,%ebp
  106044:	83 ec 28             	sub    $0x28,%esp
    void *objp = kmem_cache_alloc(cachep);
  106047:	8b 45 08             	mov    0x8(%ebp),%eax
  10604a:	89 04 24             	mov    %eax,(%esp)
  10604d:	e8 35 fb ff ff       	call   105b87 <kmem_cache_alloc>
  106052:	89 45 f4             	mov    %eax,-0xc(%ebp)
    memset(objp, 0, cachep->objsize);
  106055:	8b 45 08             	mov    0x8(%ebp),%eax
  106058:	0f b7 40 18          	movzwl 0x18(%eax),%eax
  10605c:	89 44 24 08          	mov    %eax,0x8(%esp)
  106060:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  106067:	00 
  106068:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10606b:	89 04 24             	mov    %eax,(%esp)
  10606e:	e8 6b 2c 00 00       	call   108cde <memset>
    return objp;
  106073:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  106076:	c9                   	leave  
  106077:	c3                   	ret    

00106078 <kfree>:
void kfree(void *objp) 
{
  106078:	f3 0f 1e fb          	endbr32 
  10607c:	55                   	push   %ebp
  10607d:	89 e5                	mov    %esp,%ebp
  10607f:	83 ec 28             	sub    $0x28,%esp
    void *base = page2kva(pages);
  106082:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  106087:	89 04 24             	mov    %eax,(%esp)
  10608a:	e8 f6 f4 ff ff       	call   105585 <page2kva>
  10608f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    void *kva = ROUNDDOWN(objp, PGSIZE);
  106092:	8b 45 08             	mov    0x8(%ebp),%eax
  106095:	89 45 f0             	mov    %eax,-0x10(%ebp)
  106098:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10609b:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1060a0:	89 45 ec             	mov    %eax,-0x14(%ebp)
    struct Page *slab = &pages[(kva-base)/PGSIZE];
  1060a3:	8b 0d 08 da 2a 00    	mov    0x2ada08,%ecx
  1060a9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1060ac:	2b 45 f4             	sub    -0xc(%ebp),%eax
  1060af:	8d 90 ff 0f 00 00    	lea    0xfff(%eax),%edx
  1060b5:	85 c0                	test   %eax,%eax
  1060b7:	0f 48 c2             	cmovs  %edx,%eax
  1060ba:	c1 f8 0c             	sar    $0xc,%eax
  1060bd:	89 c2                	mov    %eax,%edx
  1060bf:	89 d0                	mov    %edx,%eax
  1060c1:	c1 e0 03             	shl    $0x3,%eax
  1060c4:	01 d0                	add    %edx,%eax
  1060c6:	c1 e0 02             	shl    $0x2,%eax
  1060c9:	01 c8                	add    %ecx,%eax
  1060cb:	89 45 e8             	mov    %eax,-0x18(%ebp)
    kmem_cache_free(slab->cachep, objp);
  1060ce:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1060d1:	8b 40 14             	mov    0x14(%eax),%eax
  1060d4:	8b 55 08             	mov    0x8(%ebp),%edx
  1060d7:	89 54 24 04          	mov    %edx,0x4(%esp)
  1060db:	89 04 24             	mov    %eax,(%esp)
  1060de:	e8 96 fc ff ff       	call   105d79 <kmem_cache_free>
}
  1060e3:	90                   	nop
  1060e4:	c9                   	leave  
  1060e5:	c3                   	ret    

001060e6 <check_kmem>:
static void check_kmem() 
{
  1060e6:	f3 0f 1e fb          	endbr32 
  1060ea:	55                   	push   %ebp
  1060eb:	89 e5                	mov    %esp,%ebp
  1060ed:	53                   	push   %ebx
  1060ee:	83 ec 54             	sub    $0x54,%esp
    size_t fp = nr_free_pages();
  1060f1:	e8 54 dd ff ff       	call   103e4a <nr_free_pages>
  1060f6:	89 45 e8             	mov    %eax,-0x18(%ebp)

    // Create a cache 
    struct kmem_cache_t *cp0 = kmem_cache_create(test_object_name, sizeof(struct test_object), test_ctor, test_dtor);
  1060f9:	a1 40 3a 12 00       	mov    0x123a40,%eax
  1060fe:	c7 44 24 0c 78 56 10 	movl   $0x105678,0xc(%esp)
  106105:	00 
  106106:	c7 44 24 08 45 56 10 	movl   $0x105645,0x8(%esp)
  10610d:	00 
  10610e:	c7 44 24 04 fe 07 00 	movl   $0x7fe,0x4(%esp)
  106115:	00 
  106116:	89 04 24             	mov    %eax,(%esp)
  106119:	e8 0c f8 ff ff       	call   10592a <kmem_cache_create>
  10611e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(cp0 != NULL);
  106121:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  106125:	75 24                	jne    10614b <check_kmem+0x65>
  106127:	c7 44 24 0c d3 a4 10 	movl   $0x10a4d3,0xc(%esp)
  10612e:	00 
  10612f:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106136:	00 
  106137:	c7 44 24 04 fd 00 00 	movl   $0xfd,0x4(%esp)
  10613e:	00 
  10613f:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106146:	e8 d6 a2 ff ff       	call   100421 <__panic>
    assert(kmem_cache_size(cp0) == sizeof(struct test_object));
  10614b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10614e:	89 04 24             	mov    %eax,(%esp)
  106151:	e8 cb fd ff ff       	call   105f21 <kmem_cache_size>
  106156:	3d fe 07 00 00       	cmp    $0x7fe,%eax
  10615b:	74 24                	je     106181 <check_kmem+0x9b>
  10615d:	c7 44 24 0c e0 a4 10 	movl   $0x10a4e0,0xc(%esp)
  106164:	00 
  106165:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  10616c:	00 
  10616d:	c7 44 24 04 fe 00 00 	movl   $0xfe,0x4(%esp)
  106174:	00 
  106175:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  10617c:	e8 a0 a2 ff ff       	call   100421 <__panic>
    assert(strcmp(kmem_cache_name(cp0), test_object_name) == 0);
  106181:	8b 1d 40 3a 12 00    	mov    0x123a40,%ebx
  106187:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10618a:	89 04 24             	mov    %eax,(%esp)
  10618d:	e8 9f fd ff ff       	call   105f31 <kmem_cache_name>
  106192:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  106196:	89 04 24             	mov    %eax,(%esp)
  106199:	e8 da 28 00 00       	call   108a78 <strcmp>
  10619e:	85 c0                	test   %eax,%eax
  1061a0:	74 24                	je     1061c6 <check_kmem+0xe0>
  1061a2:	c7 44 24 0c 14 a5 10 	movl   $0x10a514,0xc(%esp)
  1061a9:	00 
  1061aa:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1061b1:	00 
  1061b2:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
  1061b9:	00 
  1061ba:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1061c1:	e8 5b a2 ff ff       	call   100421 <__panic>
    // Allocate six objects
    struct test_object *p0, *p1, *p2, *p3, *p4, *p5;
    char *p;
    assert((p0 = kmem_cache_alloc(cp0)) != NULL);
  1061c6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1061c9:	89 04 24             	mov    %eax,(%esp)
  1061cc:	e8 b6 f9 ff ff       	call   105b87 <kmem_cache_alloc>
  1061d1:	89 45 e0             	mov    %eax,-0x20(%ebp)
  1061d4:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  1061d8:	75 24                	jne    1061fe <check_kmem+0x118>
  1061da:	c7 44 24 0c 48 a5 10 	movl   $0x10a548,0xc(%esp)
  1061e1:	00 
  1061e2:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1061e9:	00 
  1061ea:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
  1061f1:	00 
  1061f2:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1061f9:	e8 23 a2 ff ff       	call   100421 <__panic>
    assert((p1 = kmem_cache_alloc(cp0)) != NULL);
  1061fe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106201:	89 04 24             	mov    %eax,(%esp)
  106204:	e8 7e f9 ff ff       	call   105b87 <kmem_cache_alloc>
  106209:	89 45 dc             	mov    %eax,-0x24(%ebp)
  10620c:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  106210:	75 24                	jne    106236 <check_kmem+0x150>
  106212:	c7 44 24 0c 70 a5 10 	movl   $0x10a570,0xc(%esp)
  106219:	00 
  10621a:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106221:	00 
  106222:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
  106229:	00 
  10622a:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106231:	e8 eb a1 ff ff       	call   100421 <__panic>
    assert((p2 = kmem_cache_alloc(cp0)) != NULL);
  106236:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106239:	89 04 24             	mov    %eax,(%esp)
  10623c:	e8 46 f9 ff ff       	call   105b87 <kmem_cache_alloc>
  106241:	89 45 d8             	mov    %eax,-0x28(%ebp)
  106244:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  106248:	75 24                	jne    10626e <check_kmem+0x188>
  10624a:	c7 44 24 0c 98 a5 10 	movl   $0x10a598,0xc(%esp)
  106251:	00 
  106252:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106259:	00 
  10625a:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
  106261:	00 
  106262:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106269:	e8 b3 a1 ff ff       	call   100421 <__panic>
    assert((p3 = kmem_cache_alloc(cp0)) != NULL);
  10626e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106271:	89 04 24             	mov    %eax,(%esp)
  106274:	e8 0e f9 ff ff       	call   105b87 <kmem_cache_alloc>
  106279:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  10627c:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  106280:	75 24                	jne    1062a6 <check_kmem+0x1c0>
  106282:	c7 44 24 0c c0 a5 10 	movl   $0x10a5c0,0xc(%esp)
  106289:	00 
  10628a:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106291:	00 
  106292:	c7 44 24 04 06 01 00 	movl   $0x106,0x4(%esp)
  106299:	00 
  10629a:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1062a1:	e8 7b a1 ff ff       	call   100421 <__panic>
    assert((p4 = kmem_cache_alloc(cp0)) != NULL);
  1062a6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1062a9:	89 04 24             	mov    %eax,(%esp)
  1062ac:	e8 d6 f8 ff ff       	call   105b87 <kmem_cache_alloc>
  1062b1:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1062b4:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
  1062b8:	75 24                	jne    1062de <check_kmem+0x1f8>
  1062ba:	c7 44 24 0c e8 a5 10 	movl   $0x10a5e8,0xc(%esp)
  1062c1:	00 
  1062c2:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1062c9:	00 
  1062ca:	c7 44 24 04 07 01 00 	movl   $0x107,0x4(%esp)
  1062d1:	00 
  1062d2:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1062d9:	e8 43 a1 ff ff       	call   100421 <__panic>
    p = (char *) p4;
  1062de:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1062e1:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (int i = 0; i < sizeof(struct test_object); i++)
  1062e4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  1062eb:	eb 36                	jmp    106323 <check_kmem+0x23d>
        assert(p[i] == TEST_OBJECT_CTVAL);
  1062ed:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1062f0:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1062f3:	01 d0                	add    %edx,%eax
  1062f5:	0f b6 00             	movzbl (%eax),%eax
  1062f8:	3c 22                	cmp    $0x22,%al
  1062fa:	74 24                	je     106320 <check_kmem+0x23a>
  1062fc:	c7 44 24 0c 0d a6 10 	movl   $0x10a60d,0xc(%esp)
  106303:	00 
  106304:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  10630b:	00 
  10630c:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
  106313:	00 
  106314:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  10631b:	e8 01 a1 ff ff       	call   100421 <__panic>
    for (int i = 0; i < sizeof(struct test_object); i++)
  106320:	ff 45 f4             	incl   -0xc(%ebp)
  106323:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106326:	3d fd 07 00 00       	cmp    $0x7fd,%eax
  10632b:	76 c0                	jbe    1062ed <check_kmem+0x207>
    assert((p5 = kmem_cache_zalloc(cp0)) != NULL);
  10632d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106330:	89 04 24             	mov    %eax,(%esp)
  106333:	e8 05 fd ff ff       	call   10603d <kmem_cache_zalloc>
  106338:	89 45 c8             	mov    %eax,-0x38(%ebp)
  10633b:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  10633f:	75 24                	jne    106365 <check_kmem+0x27f>
  106341:	c7 44 24 0c 28 a6 10 	movl   $0x10a628,0xc(%esp)
  106348:	00 
  106349:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106350:	00 
  106351:	c7 44 24 04 0b 01 00 	movl   $0x10b,0x4(%esp)
  106358:	00 
  106359:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106360:	e8 bc a0 ff ff       	call   100421 <__panic>
    p = (char *) p5;
  106365:	8b 45 c8             	mov    -0x38(%ebp),%eax
  106368:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (int i = 0; i < sizeof(struct test_object); i++)
  10636b:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  106372:	eb 36                	jmp    1063aa <check_kmem+0x2c4>
        assert(p[i] == 0);
  106374:	8b 55 f0             	mov    -0x10(%ebp),%edx
  106377:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10637a:	01 d0                	add    %edx,%eax
  10637c:	0f b6 00             	movzbl (%eax),%eax
  10637f:	84 c0                	test   %al,%al
  106381:	74 24                	je     1063a7 <check_kmem+0x2c1>
  106383:	c7 44 24 0c 4e a6 10 	movl   $0x10a64e,0xc(%esp)
  10638a:	00 
  10638b:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106392:	00 
  106393:	c7 44 24 04 0e 01 00 	movl   $0x10e,0x4(%esp)
  10639a:	00 
  10639b:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1063a2:	e8 7a a0 ff ff       	call   100421 <__panic>
    for (int i = 0; i < sizeof(struct test_object); i++)
  1063a7:	ff 45 f0             	incl   -0x10(%ebp)
  1063aa:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1063ad:	3d fd 07 00 00       	cmp    $0x7fd,%eax
  1063b2:	76 c0                	jbe    106374 <check_kmem+0x28e>
    assert(nr_free_pages()+3 == fp);
  1063b4:	e8 91 da ff ff       	call   103e4a <nr_free_pages>
  1063b9:	83 c0 03             	add    $0x3,%eax
  1063bc:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  1063bf:	74 24                	je     1063e5 <check_kmem+0x2ff>
  1063c1:	c7 44 24 0c 58 a6 10 	movl   $0x10a658,0xc(%esp)
  1063c8:	00 
  1063c9:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1063d0:	00 
  1063d1:	c7 44 24 04 0f 01 00 	movl   $0x10f,0x4(%esp)
  1063d8:	00 
  1063d9:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1063e0:	e8 3c a0 ff ff       	call   100421 <__panic>
    assert(list_empty(&(cp0->slabs_free)));
  1063e5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1063e8:	83 c0 10             	add    $0x10,%eax
  1063eb:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return list->next == list;
  1063ee:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  1063f1:	8b 40 04             	mov    0x4(%eax),%eax
  1063f4:	39 45 c4             	cmp    %eax,-0x3c(%ebp)
  1063f7:	0f 94 c0             	sete   %al
  1063fa:	0f b6 c0             	movzbl %al,%eax
  1063fd:	85 c0                	test   %eax,%eax
  1063ff:	75 24                	jne    106425 <check_kmem+0x33f>
  106401:	c7 44 24 0c 70 a6 10 	movl   $0x10a670,0xc(%esp)
  106408:	00 
  106409:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106410:	00 
  106411:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
  106418:	00 
  106419:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106420:	e8 fc 9f ff ff       	call   100421 <__panic>
    assert(list_empty(&(cp0->slabs_partial)));
  106425:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106428:	83 c0 08             	add    $0x8,%eax
  10642b:	89 45 c0             	mov    %eax,-0x40(%ebp)
  10642e:	8b 45 c0             	mov    -0x40(%ebp),%eax
  106431:	8b 40 04             	mov    0x4(%eax),%eax
  106434:	39 45 c0             	cmp    %eax,-0x40(%ebp)
  106437:	0f 94 c0             	sete   %al
  10643a:	0f b6 c0             	movzbl %al,%eax
  10643d:	85 c0                	test   %eax,%eax
  10643f:	75 24                	jne    106465 <check_kmem+0x37f>
  106441:	c7 44 24 0c 90 a6 10 	movl   $0x10a690,0xc(%esp)
  106448:	00 
  106449:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106450:	00 
  106451:	c7 44 24 04 11 01 00 	movl   $0x111,0x4(%esp)
  106458:	00 
  106459:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106460:	e8 bc 9f ff ff       	call   100421 <__panic>
    assert(list_length(&(cp0->slabs_full)) == 3);
  106465:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106468:	89 04 24             	mov    %eax,(%esp)
  10646b:	e8 3b f2 ff ff       	call   1056ab <list_length>
  106470:	83 f8 03             	cmp    $0x3,%eax
  106473:	74 24                	je     106499 <check_kmem+0x3b3>
  106475:	c7 44 24 0c b4 a6 10 	movl   $0x10a6b4,0xc(%esp)
  10647c:	00 
  10647d:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106484:	00 
  106485:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
  10648c:	00 
  10648d:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106494:	e8 88 9f ff ff       	call   100421 <__panic>
    // Free three objects 
    kmem_cache_free(cp0, p3);
  106499:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10649c:	89 44 24 04          	mov    %eax,0x4(%esp)
  1064a0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1064a3:	89 04 24             	mov    %eax,(%esp)
  1064a6:	e8 ce f8 ff ff       	call   105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p4);
  1064ab:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1064ae:	89 44 24 04          	mov    %eax,0x4(%esp)
  1064b2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1064b5:	89 04 24             	mov    %eax,(%esp)
  1064b8:	e8 bc f8 ff ff       	call   105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p5);
  1064bd:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1064c0:	89 44 24 04          	mov    %eax,0x4(%esp)
  1064c4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1064c7:	89 04 24             	mov    %eax,(%esp)
  1064ca:	e8 aa f8 ff ff       	call   105d79 <kmem_cache_free>
    assert(list_length(&(cp0->slabs_free)) == 1);
  1064cf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1064d2:	83 c0 10             	add    $0x10,%eax
  1064d5:	89 04 24             	mov    %eax,(%esp)
  1064d8:	e8 ce f1 ff ff       	call   1056ab <list_length>
  1064dd:	83 f8 01             	cmp    $0x1,%eax
  1064e0:	74 24                	je     106506 <check_kmem+0x420>
  1064e2:	c7 44 24 0c dc a6 10 	movl   $0x10a6dc,0xc(%esp)
  1064e9:	00 
  1064ea:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1064f1:	00 
  1064f2:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
  1064f9:	00 
  1064fa:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106501:	e8 1b 9f ff ff       	call   100421 <__panic>
    assert(list_length(&(cp0->slabs_partial)) == 1);
  106506:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106509:	83 c0 08             	add    $0x8,%eax
  10650c:	89 04 24             	mov    %eax,(%esp)
  10650f:	e8 97 f1 ff ff       	call   1056ab <list_length>
  106514:	83 f8 01             	cmp    $0x1,%eax
  106517:	74 24                	je     10653d <check_kmem+0x457>
  106519:	c7 44 24 0c 04 a7 10 	movl   $0x10a704,0xc(%esp)
  106520:	00 
  106521:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106528:	00 
  106529:	c7 44 24 04 18 01 00 	movl   $0x118,0x4(%esp)
  106530:	00 
  106531:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106538:	e8 e4 9e ff ff       	call   100421 <__panic>
    assert(list_length(&(cp0->slabs_full)) == 1);
  10653d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106540:	89 04 24             	mov    %eax,(%esp)
  106543:	e8 63 f1 ff ff       	call   1056ab <list_length>
  106548:	83 f8 01             	cmp    $0x1,%eax
  10654b:	74 24                	je     106571 <check_kmem+0x48b>
  10654d:	c7 44 24 0c 2c a7 10 	movl   $0x10a72c,0xc(%esp)
  106554:	00 
  106555:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  10655c:	00 
  10655d:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
  106564:	00 
  106565:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  10656c:	e8 b0 9e ff ff       	call   100421 <__panic>
    // Shrink cache 
    assert(kmem_cache_shrink(cp0) == 1);
  106571:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106574:	89 04 24             	mov    %eax,(%esp)
  106577:	e8 c4 f9 ff ff       	call   105f40 <kmem_cache_shrink>
  10657c:	83 f8 01             	cmp    $0x1,%eax
  10657f:	74 24                	je     1065a5 <check_kmem+0x4bf>
  106581:	c7 44 24 0c 51 a7 10 	movl   $0x10a751,0xc(%esp)
  106588:	00 
  106589:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106590:	00 
  106591:	c7 44 24 04 1b 01 00 	movl   $0x11b,0x4(%esp)
  106598:	00 
  106599:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1065a0:	e8 7c 9e ff ff       	call   100421 <__panic>
    assert(nr_free_pages()+2 == fp);
  1065a5:	e8 a0 d8 ff ff       	call   103e4a <nr_free_pages>
  1065aa:	83 c0 02             	add    $0x2,%eax
  1065ad:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  1065b0:	74 24                	je     1065d6 <check_kmem+0x4f0>
  1065b2:	c7 44 24 0c 6d a7 10 	movl   $0x10a76d,0xc(%esp)
  1065b9:	00 
  1065ba:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1065c1:	00 
  1065c2:	c7 44 24 04 1c 01 00 	movl   $0x11c,0x4(%esp)
  1065c9:	00 
  1065ca:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1065d1:	e8 4b 9e ff ff       	call   100421 <__panic>
    assert(list_empty(&(cp0->slabs_free)));
  1065d6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1065d9:	83 c0 10             	add    $0x10,%eax
  1065dc:	89 45 bc             	mov    %eax,-0x44(%ebp)
  1065df:	8b 45 bc             	mov    -0x44(%ebp),%eax
  1065e2:	8b 40 04             	mov    0x4(%eax),%eax
  1065e5:	39 45 bc             	cmp    %eax,-0x44(%ebp)
  1065e8:	0f 94 c0             	sete   %al
  1065eb:	0f b6 c0             	movzbl %al,%eax
  1065ee:	85 c0                	test   %eax,%eax
  1065f0:	75 24                	jne    106616 <check_kmem+0x530>
  1065f2:	c7 44 24 0c 70 a6 10 	movl   $0x10a670,0xc(%esp)
  1065f9:	00 
  1065fa:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106601:	00 
  106602:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
  106609:	00 
  10660a:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106611:	e8 0b 9e ff ff       	call   100421 <__panic>
    p = (char *) p4;
  106616:	8b 45 d0             	mov    -0x30(%ebp),%eax
  106619:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (int i = 0; i < sizeof(struct test_object); i++)
  10661c:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  106623:	eb 36                	jmp    10665b <check_kmem+0x575>
        assert(p[i] == TEST_OBJECT_DTVAL);
  106625:	8b 55 ec             	mov    -0x14(%ebp),%edx
  106628:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10662b:	01 d0                	add    %edx,%eax
  10662d:	0f b6 00             	movzbl (%eax),%eax
  106630:	3c 11                	cmp    $0x11,%al
  106632:	74 24                	je     106658 <check_kmem+0x572>
  106634:	c7 44 24 0c 85 a7 10 	movl   $0x10a785,0xc(%esp)
  10663b:	00 
  10663c:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106643:	00 
  106644:	c7 44 24 04 20 01 00 	movl   $0x120,0x4(%esp)
  10664b:	00 
  10664c:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106653:	e8 c9 9d ff ff       	call   100421 <__panic>
    for (int i = 0; i < sizeof(struct test_object); i++)
  106658:	ff 45 ec             	incl   -0x14(%ebp)
  10665b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10665e:	3d fd 07 00 00       	cmp    $0x7fd,%eax
  106663:	76 c0                	jbe    106625 <check_kmem+0x53f>
    // Reap cache 
    kmem_cache_free(cp0, p0);
  106665:	8b 45 e0             	mov    -0x20(%ebp),%eax
  106668:	89 44 24 04          	mov    %eax,0x4(%esp)
  10666c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10666f:	89 04 24             	mov    %eax,(%esp)
  106672:	e8 02 f7 ff ff       	call   105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p1);
  106677:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10667a:	89 44 24 04          	mov    %eax,0x4(%esp)
  10667e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106681:	89 04 24             	mov    %eax,(%esp)
  106684:	e8 f0 f6 ff ff       	call   105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p2);
  106689:	8b 45 d8             	mov    -0x28(%ebp),%eax
  10668c:	89 44 24 04          	mov    %eax,0x4(%esp)
  106690:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106693:	89 04 24             	mov    %eax,(%esp)
  106696:	e8 de f6 ff ff       	call   105d79 <kmem_cache_free>
    assert(kmem_cache_reap() == 2);
  10669b:	e8 02 f9 ff ff       	call   105fa2 <kmem_cache_reap>
  1066a0:	83 f8 02             	cmp    $0x2,%eax
  1066a3:	74 24                	je     1066c9 <check_kmem+0x5e3>
  1066a5:	c7 44 24 0c 9f a7 10 	movl   $0x10a79f,0xc(%esp)
  1066ac:	00 
  1066ad:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1066b4:	00 
  1066b5:	c7 44 24 04 25 01 00 	movl   $0x125,0x4(%esp)
  1066bc:	00 
  1066bd:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1066c4:	e8 58 9d ff ff       	call   100421 <__panic>
    assert(nr_free_pages() == fp);
  1066c9:	e8 7c d7 ff ff       	call   103e4a <nr_free_pages>
  1066ce:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  1066d1:	74 24                	je     1066f7 <check_kmem+0x611>
  1066d3:	c7 44 24 0c b6 a7 10 	movl   $0x10a7b6,0xc(%esp)
  1066da:	00 
  1066db:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1066e2:	00 
  1066e3:	c7 44 24 04 26 01 00 	movl   $0x126,0x4(%esp)
  1066ea:	00 
  1066eb:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1066f2:	e8 2a 9d ff ff       	call   100421 <__panic>
    // Destory a cache 
    kmem_cache_destroy(cp0);
  1066f7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1066fa:	89 04 24             	mov    %eax,(%esp)
  1066fd:	e8 84 f3 ff ff       	call   105a86 <kmem_cache_destroy>

    // Sized alloc 
    assert((p0 = kmalloc(2048)) != NULL);
  106702:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
  106709:	e8 dc f8 ff ff       	call   105fea <kmalloc>
  10670e:	89 45 e0             	mov    %eax,-0x20(%ebp)
  106711:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  106715:	75 24                	jne    10673b <check_kmem+0x655>
  106717:	c7 44 24 0c cc a7 10 	movl   $0x10a7cc,0xc(%esp)
  10671e:	00 
  10671f:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106726:	00 
  106727:	c7 44 24 04 2b 01 00 	movl   $0x12b,0x4(%esp)
  10672e:	00 
  10672f:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106736:	e8 e6 9c ff ff       	call   100421 <__panic>
    assert(nr_free_pages()+1 == fp);
  10673b:	e8 0a d7 ff ff       	call   103e4a <nr_free_pages>
  106740:	40                   	inc    %eax
  106741:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  106744:	74 24                	je     10676a <check_kmem+0x684>
  106746:	c7 44 24 0c e9 a7 10 	movl   $0x10a7e9,0xc(%esp)
  10674d:	00 
  10674e:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  106755:	00 
  106756:	c7 44 24 04 2c 01 00 	movl   $0x12c,0x4(%esp)
  10675d:	00 
  10675e:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  106765:	e8 b7 9c ff ff       	call   100421 <__panic>
    kfree(p0);
  10676a:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10676d:	89 04 24             	mov    %eax,(%esp)
  106770:	e8 03 f9 ff ff       	call   106078 <kfree>
    assert(kmem_cache_reap() == 1);
  106775:	e8 28 f8 ff ff       	call   105fa2 <kmem_cache_reap>
  10677a:	83 f8 01             	cmp    $0x1,%eax
  10677d:	74 24                	je     1067a3 <check_kmem+0x6bd>
  10677f:	c7 44 24 0c 01 a8 10 	movl   $0x10a801,0xc(%esp)
  106786:	00 
  106787:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  10678e:	00 
  10678f:	c7 44 24 04 2e 01 00 	movl   $0x12e,0x4(%esp)
  106796:	00 
  106797:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  10679e:	e8 7e 9c ff ff       	call   100421 <__panic>
    assert(nr_free_pages() == fp);
  1067a3:	e8 a2 d6 ff ff       	call   103e4a <nr_free_pages>
  1067a8:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  1067ab:	74 24                	je     1067d1 <check_kmem+0x6eb>
  1067ad:	c7 44 24 0c b6 a7 10 	movl   $0x10a7b6,0xc(%esp)
  1067b4:	00 
  1067b5:	c7 44 24 08 97 a4 10 	movl   $0x10a497,0x8(%esp)
  1067bc:	00 
  1067bd:	c7 44 24 04 2f 01 00 	movl   $0x12f,0x4(%esp)
  1067c4:	00 
  1067c5:	c7 04 24 ac a4 10 00 	movl   $0x10a4ac,(%esp)
  1067cc:	e8 50 9c ff ff       	call   100421 <__panic>

    cprintf("check_kmem() succeeded!\n");
  1067d1:	c7 04 24 18 a8 10 00 	movl   $0x10a818,(%esp)
  1067d8:	e8 d8 9a ff ff       	call   1002b5 <cprintf>

}
  1067dd:	90                   	nop
  1067de:	83 c4 54             	add    $0x54,%esp
  1067e1:	5b                   	pop    %ebx
  1067e2:	5d                   	pop    %ebp
  1067e3:	c3                   	ret    

001067e4 <kmem_int>:
void kmem_int() 
{
  1067e4:	f3 0f 1e fb          	endbr32 
  1067e8:	55                   	push   %ebp
  1067e9:	89 e5                	mov    %esp,%ebp
  1067eb:	83 ec 58             	sub    $0x58,%esp

    // Init cache for kmem_cache
    cache_cache.objsize = sizeof(struct kmem_cache_t);
  1067ee:	66 c7 05 58 6f 12 00 	movw   $0x3c,0x126f58
  1067f5:	3c 00 
    cache_cache.num = PGSIZE / (sizeof(int16_t) + sizeof(struct kmem_cache_t));
  1067f7:	66 c7 05 5a 6f 12 00 	movw   $0x42,0x126f5a
  1067fe:	42 00 
    cache_cache.ctor = NULL;
  106800:	c7 05 5c 6f 12 00 00 	movl   $0x0,0x126f5c
  106807:	00 00 00 
    cache_cache.dtor = NULL;
  10680a:	c7 05 60 6f 12 00 00 	movl   $0x0,0x126f60
  106811:	00 00 00 
    memcpy(cache_cache.name, cache_cache_name, CACHE_NAMELEN);
  106814:	a1 38 3a 12 00       	mov    0x123a38,%eax
  106819:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
  106820:	00 
  106821:	89 44 24 04          	mov    %eax,0x4(%esp)
  106825:	c7 04 24 64 6f 12 00 	movl   $0x126f64,(%esp)
  10682c:	e8 97 25 00 00       	call   108dc8 <memcpy>
  106831:	c7 45 c4 40 6f 12 00 	movl   $0x126f40,-0x3c(%ebp)
    elm->prev = elm->next = elm;
  106838:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  10683b:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  10683e:	89 50 04             	mov    %edx,0x4(%eax)
  106841:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  106844:	8b 50 04             	mov    0x4(%eax),%edx
  106847:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  10684a:	89 10                	mov    %edx,(%eax)
}
  10684c:	90                   	nop
  10684d:	c7 45 c8 48 6f 12 00 	movl   $0x126f48,-0x38(%ebp)
    elm->prev = elm->next = elm;
  106854:	8b 45 c8             	mov    -0x38(%ebp),%eax
  106857:	8b 55 c8             	mov    -0x38(%ebp),%edx
  10685a:	89 50 04             	mov    %edx,0x4(%eax)
  10685d:	8b 45 c8             	mov    -0x38(%ebp),%eax
  106860:	8b 50 04             	mov    0x4(%eax),%edx
  106863:	8b 45 c8             	mov    -0x38(%ebp),%eax
  106866:	89 10                	mov    %edx,(%eax)
}
  106868:	90                   	nop
  106869:	c7 45 cc 50 6f 12 00 	movl   $0x126f50,-0x34(%ebp)
    elm->prev = elm->next = elm;
  106870:	8b 45 cc             	mov    -0x34(%ebp),%eax
  106873:	8b 55 cc             	mov    -0x34(%ebp),%edx
  106876:	89 50 04             	mov    %edx,0x4(%eax)
  106879:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10687c:	8b 50 04             	mov    0x4(%eax),%edx
  10687f:	8b 45 cc             	mov    -0x34(%ebp),%eax
  106882:	89 10                	mov    %edx,(%eax)
}
  106884:	90                   	nop
  106885:	c7 45 d0 20 6f 12 00 	movl   $0x126f20,-0x30(%ebp)
    elm->prev = elm->next = elm;
  10688c:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10688f:	8b 55 d0             	mov    -0x30(%ebp),%edx
  106892:	89 50 04             	mov    %edx,0x4(%eax)
  106895:	8b 45 d0             	mov    -0x30(%ebp),%eax
  106898:	8b 50 04             	mov    0x4(%eax),%edx
  10689b:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10689e:	89 10                	mov    %edx,(%eax)
}
  1068a0:	90                   	nop
  1068a1:	c7 45 ec 20 6f 12 00 	movl   $0x126f20,-0x14(%ebp)
  1068a8:	c7 45 e8 74 6f 12 00 	movl   $0x126f74,-0x18(%ebp)
  1068af:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1068b2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1068b5:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1068b8:	89 45 e0             	mov    %eax,-0x20(%ebp)
    __list_add(elm, listelm, listelm->next);
  1068bb:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1068be:	8b 40 04             	mov    0x4(%eax),%eax
  1068c1:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1068c4:	89 55 dc             	mov    %edx,-0x24(%ebp)
  1068c7:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  1068ca:	89 55 d8             	mov    %edx,-0x28(%ebp)
  1068cd:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    prev->next = next->prev = elm;
  1068d0:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1068d3:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1068d6:	89 10                	mov    %edx,(%eax)
  1068d8:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1068db:	8b 10                	mov    (%eax),%edx
  1068dd:	8b 45 d8             	mov    -0x28(%ebp),%eax
  1068e0:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  1068e3:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1068e6:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1068e9:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  1068ec:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1068ef:	8b 55 d8             	mov    -0x28(%ebp),%edx
  1068f2:	89 10                	mov    %edx,(%eax)
}
  1068f4:	90                   	nop
}
  1068f5:	90                   	nop
}
  1068f6:	90                   	nop
    list_init(&(cache_cache.slabs_free));
    list_init(&(cache_chain));
    list_add(&(cache_chain), &(cache_cache.cache_link));

    // Init sized cache 
    for (int i = 0, size = 16; i < SIZED_CACHE_NUM; i++, size *= 2)
  1068f7:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  1068fe:	c7 45 f0 10 00 00 00 	movl   $0x10,-0x10(%ebp)
  106905:	eb 34                	jmp    10693b <kmem_int+0x157>
        sized_caches[i] = kmem_cache_create(sized_cache_name, size, NULL, NULL); 
  106907:	8b 55 f0             	mov    -0x10(%ebp),%edx
  10690a:	a1 3c 3a 12 00       	mov    0x123a3c,%eax
  10690f:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  106916:	00 
  106917:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  10691e:	00 
  10691f:	89 54 24 04          	mov    %edx,0x4(%esp)
  106923:	89 04 24             	mov    %eax,(%esp)
  106926:	e8 ff ef ff ff       	call   10592a <kmem_cache_create>
  10692b:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10692e:	89 04 95 80 6f 12 00 	mov    %eax,0x126f80(,%edx,4)
    for (int i = 0, size = 16; i < SIZED_CACHE_NUM; i++, size *= 2)
  106935:	ff 45 f4             	incl   -0xc(%ebp)
  106938:	d1 65 f0             	shll   -0x10(%ebp)
  10693b:	83 7d f4 07          	cmpl   $0x7,-0xc(%ebp)
  10693f:	7e c6                	jle    106907 <kmem_int+0x123>

    check_kmem();
  106941:	e8 a0 f7 ff ff       	call   1060e6 <check_kmem>
}
  106946:	90                   	nop
  106947:	c9                   	leave  
  106948:	c3                   	ret    

00106949 <page2ppn>:
page2ppn(struct Page *page) {
  106949:	55                   	push   %ebp
  10694a:	89 e5                	mov    %esp,%ebp
    return page - pages;
  10694c:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  106951:	8b 55 08             	mov    0x8(%ebp),%edx
  106954:	29 c2                	sub    %eax,%edx
  106956:	89 d0                	mov    %edx,%eax
  106958:	c1 f8 02             	sar    $0x2,%eax
  10695b:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
  106961:	5d                   	pop    %ebp
  106962:	c3                   	ret    

00106963 <page2pa>:
page2pa(struct Page *page) {
  106963:	55                   	push   %ebp
  106964:	89 e5                	mov    %esp,%ebp
  106966:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  106969:	8b 45 08             	mov    0x8(%ebp),%eax
  10696c:	89 04 24             	mov    %eax,(%esp)
  10696f:	e8 d5 ff ff ff       	call   106949 <page2ppn>
  106974:	c1 e0 0c             	shl    $0xc,%eax
}
  106977:	c9                   	leave  
  106978:	c3                   	ret    

00106979 <page_ref>:
page_ref(struct Page *page) {
  106979:	55                   	push   %ebp
  10697a:	89 e5                	mov    %esp,%ebp
    return page->ref;
  10697c:	8b 45 08             	mov    0x8(%ebp),%eax
  10697f:	8b 00                	mov    (%eax),%eax
}
  106981:	5d                   	pop    %ebp
  106982:	c3                   	ret    

00106983 <set_page_ref>:
set_page_ref(struct Page *page, int val) {
  106983:	55                   	push   %ebp
  106984:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  106986:	8b 45 08             	mov    0x8(%ebp),%eax
  106989:	8b 55 0c             	mov    0xc(%ebp),%edx
  10698c:	89 10                	mov    %edx,(%eax)
}
  10698e:	90                   	nop
  10698f:	5d                   	pop    %ebp
  106990:	c3                   	ret    

00106991 <default_init>:

#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
default_init(void) {
  106991:	f3 0f 1e fb          	endbr32 
  106995:	55                   	push   %ebp
  106996:	89 e5                	mov    %esp,%ebp
  106998:	83 ec 10             	sub    $0x10,%esp
  10699b:	c7 45 fc e0 33 1c 00 	movl   $0x1c33e0,-0x4(%ebp)
    elm->prev = elm->next = elm;
  1069a2:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1069a5:	8b 55 fc             	mov    -0x4(%ebp),%edx
  1069a8:	89 50 04             	mov    %edx,0x4(%eax)
  1069ab:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1069ae:	8b 50 04             	mov    0x4(%eax),%edx
  1069b1:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1069b4:	89 10                	mov    %edx,(%eax)
}
  1069b6:	90                   	nop
    list_init(&free_list);
    nr_free = 0;
  1069b7:	c7 05 e8 33 1c 00 00 	movl   $0x0,0x1c33e8
  1069be:	00 00 00 
}
  1069c1:	90                   	nop
  1069c2:	c9                   	leave  
  1069c3:	c3                   	ret    

001069c4 <default_init_memmap>:

static void
default_init_memmap(struct Page *base, size_t n) {
  1069c4:	f3 0f 1e fb          	endbr32 
  1069c8:	55                   	push   %ebp
  1069c9:	89 e5                	mov    %esp,%ebp
  1069cb:	83 ec 58             	sub    $0x58,%esp
    assert(n > 0);
  1069ce:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  1069d2:	75 24                	jne    1069f8 <default_init_memmap+0x34>
  1069d4:	c7 44 24 0c 34 a8 10 	movl   $0x10a834,0xc(%esp)
  1069db:	00 
  1069dc:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1069e3:	00 
  1069e4:	c7 44 24 04 6d 00 00 	movl   $0x6d,0x4(%esp)
  1069eb:	00 
  1069ec:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1069f3:	e8 29 9a ff ff       	call   100421 <__panic>
    struct Page *p = base;
  1069f8:	8b 45 08             	mov    0x8(%ebp),%eax
  1069fb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
  1069fe:	eb 7d                	jmp    106a7d <default_init_memmap+0xb9>
        assert(PageReserved(p));
  106a00:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106a03:	83 c0 04             	add    $0x4,%eax
  106a06:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  106a0d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  106a10:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106a13:	8b 55 f0             	mov    -0x10(%ebp),%edx
  106a16:	0f a3 10             	bt     %edx,(%eax)
  106a19:	19 c0                	sbb    %eax,%eax
  106a1b:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
  106a1e:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  106a22:	0f 95 c0             	setne  %al
  106a25:	0f b6 c0             	movzbl %al,%eax
  106a28:	85 c0                	test   %eax,%eax
  106a2a:	75 24                	jne    106a50 <default_init_memmap+0x8c>
  106a2c:	c7 44 24 0c 65 a8 10 	movl   $0x10a865,0xc(%esp)
  106a33:	00 
  106a34:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  106a3b:	00 
  106a3c:	c7 44 24 04 70 00 00 	movl   $0x70,0x4(%esp)
  106a43:	00 
  106a44:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  106a4b:	e8 d1 99 ff ff       	call   100421 <__panic>
        p->flags = p->property = 0;
  106a50:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106a53:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
  106a5a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106a5d:	8b 50 08             	mov    0x8(%eax),%edx
  106a60:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106a63:	89 50 04             	mov    %edx,0x4(%eax)
        set_page_ref(p, 0);
  106a66:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  106a6d:	00 
  106a6e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106a71:	89 04 24             	mov    %eax,(%esp)
  106a74:	e8 0a ff ff ff       	call   106983 <set_page_ref>
    for (; p != base + n; p ++) {
  106a79:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
  106a7d:	8b 55 0c             	mov    0xc(%ebp),%edx
  106a80:	89 d0                	mov    %edx,%eax
  106a82:	c1 e0 03             	shl    $0x3,%eax
  106a85:	01 d0                	add    %edx,%eax
  106a87:	c1 e0 02             	shl    $0x2,%eax
  106a8a:	89 c2                	mov    %eax,%edx
  106a8c:	8b 45 08             	mov    0x8(%ebp),%eax
  106a8f:	01 d0                	add    %edx,%eax
  106a91:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  106a94:	0f 85 66 ff ff ff    	jne    106a00 <default_init_memmap+0x3c>
    }
    base->property = n;
  106a9a:	8b 45 08             	mov    0x8(%ebp),%eax
  106a9d:	8b 55 0c             	mov    0xc(%ebp),%edx
  106aa0:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
  106aa3:	8b 45 08             	mov    0x8(%ebp),%eax
  106aa6:	83 c0 04             	add    $0x4,%eax
  106aa9:	c7 45 c8 01 00 00 00 	movl   $0x1,-0x38(%ebp)
  106ab0:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  106ab3:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  106ab6:	8b 55 c8             	mov    -0x38(%ebp),%edx
  106ab9:	0f ab 10             	bts    %edx,(%eax)
}
  106abc:	90                   	nop
    nr_free += n;
  106abd:	8b 15 e8 33 1c 00    	mov    0x1c33e8,%edx
  106ac3:	8b 45 0c             	mov    0xc(%ebp),%eax
  106ac6:	01 d0                	add    %edx,%eax
  106ac8:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8
    list_add(&free_list, &(base->page_link));
  106acd:	8b 45 08             	mov    0x8(%ebp),%eax
  106ad0:	83 c0 0c             	add    $0xc,%eax
  106ad3:	c7 45 e4 e0 33 1c 00 	movl   $0x1c33e0,-0x1c(%ebp)
  106ada:	89 45 e0             	mov    %eax,-0x20(%ebp)
  106add:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106ae0:	89 45 dc             	mov    %eax,-0x24(%ebp)
  106ae3:	8b 45 e0             	mov    -0x20(%ebp),%eax
  106ae6:	89 45 d8             	mov    %eax,-0x28(%ebp)
    __list_add(elm, listelm, listelm->next);
  106ae9:	8b 45 dc             	mov    -0x24(%ebp),%eax
  106aec:	8b 40 04             	mov    0x4(%eax),%eax
  106aef:	8b 55 d8             	mov    -0x28(%ebp),%edx
  106af2:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  106af5:	8b 55 dc             	mov    -0x24(%ebp),%edx
  106af8:	89 55 d0             	mov    %edx,-0x30(%ebp)
  106afb:	89 45 cc             	mov    %eax,-0x34(%ebp)
    prev->next = next->prev = elm;
  106afe:	8b 45 cc             	mov    -0x34(%ebp),%eax
  106b01:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  106b04:	89 10                	mov    %edx,(%eax)
  106b06:	8b 45 cc             	mov    -0x34(%ebp),%eax
  106b09:	8b 10                	mov    (%eax),%edx
  106b0b:	8b 45 d0             	mov    -0x30(%ebp),%eax
  106b0e:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  106b11:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  106b14:	8b 55 cc             	mov    -0x34(%ebp),%edx
  106b17:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  106b1a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  106b1d:	8b 55 d0             	mov    -0x30(%ebp),%edx
  106b20:	89 10                	mov    %edx,(%eax)
}
  106b22:	90                   	nop
}
  106b23:	90                   	nop
}
  106b24:	90                   	nop
}
  106b25:	90                   	nop
  106b26:	c9                   	leave  
  106b27:	c3                   	ret    

00106b28 <default_alloc_pages>:

static struct Page *
default_alloc_pages(size_t n) {
  106b28:	f3 0f 1e fb          	endbr32 
  106b2c:	55                   	push   %ebp
  106b2d:	89 e5                	mov    %esp,%ebp
  106b2f:	83 ec 78             	sub    $0x78,%esp
    assert(n > 0);
  106b32:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  106b36:	75 24                	jne    106b5c <default_alloc_pages+0x34>
  106b38:	c7 44 24 0c 34 a8 10 	movl   $0x10a834,0xc(%esp)
  106b3f:	00 
  106b40:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  106b47:	00 
  106b48:	c7 44 24 04 7c 00 00 	movl   $0x7c,0x4(%esp)
  106b4f:	00 
  106b50:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  106b57:	e8 c5 98 ff ff       	call   100421 <__panic>
    if (n > nr_free) {
  106b5c:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  106b61:	39 45 08             	cmp    %eax,0x8(%ebp)
  106b64:	76 0a                	jbe    106b70 <default_alloc_pages+0x48>
        return NULL;
  106b66:	b8 00 00 00 00       	mov    $0x0,%eax
  106b6b:	e9 78 01 00 00       	jmp    106ce8 <default_alloc_pages+0x1c0>
    }
    struct Page *page = NULL;
  106b70:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &free_list;
  106b77:	c7 45 f0 e0 33 1c 00 	movl   $0x1c33e0,-0x10(%ebp)
    while ((le = list_next(le)) != &free_list) {
  106b7e:	eb 1c                	jmp    106b9c <default_alloc_pages+0x74>
        struct Page *p = le2page(le, page_link);
  106b80:	8b 45 f0             	mov    -0x10(%ebp),%eax
  106b83:	83 e8 0c             	sub    $0xc,%eax
  106b86:	89 45 e8             	mov    %eax,-0x18(%ebp)
        if (p->property >= n) {
  106b89:	8b 45 e8             	mov    -0x18(%ebp),%eax
  106b8c:	8b 40 08             	mov    0x8(%eax),%eax
  106b8f:	39 45 08             	cmp    %eax,0x8(%ebp)
  106b92:	77 08                	ja     106b9c <default_alloc_pages+0x74>
            page = p;
  106b94:	8b 45 e8             	mov    -0x18(%ebp),%eax
  106b97:	89 45 f4             	mov    %eax,-0xc(%ebp)
            break;
  106b9a:	eb 18                	jmp    106bb4 <default_alloc_pages+0x8c>
  106b9c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  106b9f:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return listelm->next;
  106ba2:	8b 45 e0             	mov    -0x20(%ebp),%eax
  106ba5:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
  106ba8:	89 45 f0             	mov    %eax,-0x10(%ebp)
  106bab:	81 7d f0 e0 33 1c 00 	cmpl   $0x1c33e0,-0x10(%ebp)
  106bb2:	75 cc                	jne    106b80 <default_alloc_pages+0x58>
        }
    }
    struct list_entry_t* it;
    if (page != NULL) {
  106bb4:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  106bb8:	0f 84 27 01 00 00    	je     106ce5 <default_alloc_pages+0x1bd>
        list_del(&(page->page_link));
  106bbe:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106bc1:	83 c0 0c             	add    $0xc,%eax
  106bc4:	89 45 dc             	mov    %eax,-0x24(%ebp)
    __list_del(listelm->prev, listelm->next);
  106bc7:	8b 45 dc             	mov    -0x24(%ebp),%eax
  106bca:	8b 40 04             	mov    0x4(%eax),%eax
  106bcd:	8b 55 dc             	mov    -0x24(%ebp),%edx
  106bd0:	8b 12                	mov    (%edx),%edx
  106bd2:	89 55 d8             	mov    %edx,-0x28(%ebp)
  106bd5:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    prev->next = next;
  106bd8:	8b 45 d8             	mov    -0x28(%ebp),%eax
  106bdb:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  106bde:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  106be1:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  106be4:	8b 55 d8             	mov    -0x28(%ebp),%edx
  106be7:	89 10                	mov    %edx,(%eax)
}
  106be9:	90                   	nop
}
  106bea:	90                   	nop
        if (page->property > n) {
  106beb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106bee:	8b 40 08             	mov    0x8(%eax),%eax
  106bf1:	39 45 08             	cmp    %eax,0x8(%ebp)
  106bf4:	0f 83 c4 00 00 00    	jae    106cbe <default_alloc_pages+0x196>
            struct Page *p = page + n;
  106bfa:	8b 55 08             	mov    0x8(%ebp),%edx
  106bfd:	89 d0                	mov    %edx,%eax
  106bff:	c1 e0 03             	shl    $0x3,%eax
  106c02:	01 d0                	add    %edx,%eax
  106c04:	c1 e0 02             	shl    $0x2,%eax
  106c07:	89 c2                	mov    %eax,%edx
  106c09:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106c0c:	01 d0                	add    %edx,%eax
  106c0e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            p->property = page->property - n;
  106c11:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106c14:	8b 40 08             	mov    0x8(%eax),%eax
  106c17:	2b 45 08             	sub    0x8(%ebp),%eax
  106c1a:	89 c2                	mov    %eax,%edx
  106c1c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106c1f:	89 50 08             	mov    %edx,0x8(%eax)
  106c22:	c7 45 d0 e0 33 1c 00 	movl   $0x1c33e0,-0x30(%ebp)
    return listelm->next;
  106c29:	8b 45 d0             	mov    -0x30(%ebp),%eax
  106c2c:	8b 40 04             	mov    0x4(%eax),%eax
            for(it=list_next(&free_list);it!=&free_list && le2page(it,page_link)->property < p->property;it=list_next(it));
  106c2f:	89 45 ec             	mov    %eax,-0x14(%ebp)
  106c32:	eb 0f                	jmp    106c43 <default_alloc_pages+0x11b>
  106c34:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106c37:	89 45 cc             	mov    %eax,-0x34(%ebp)
  106c3a:	8b 45 cc             	mov    -0x34(%ebp),%eax
  106c3d:	8b 40 04             	mov    0x4(%eax),%eax
  106c40:	89 45 ec             	mov    %eax,-0x14(%ebp)
  106c43:	81 7d ec e0 33 1c 00 	cmpl   $0x1c33e0,-0x14(%ebp)
  106c4a:	74 13                	je     106c5f <default_alloc_pages+0x137>
  106c4c:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106c4f:	83 e8 0c             	sub    $0xc,%eax
  106c52:	8b 50 08             	mov    0x8(%eax),%edx
  106c55:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106c58:	8b 40 08             	mov    0x8(%eax),%eax
  106c5b:	39 c2                	cmp    %eax,%edx
  106c5d:	72 d5                	jb     106c34 <default_alloc_pages+0x10c>
            list_add(list_prev(it), &(p->page_link));
  106c5f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106c62:	8d 50 0c             	lea    0xc(%eax),%edx
  106c65:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106c68:	89 45 ac             	mov    %eax,-0x54(%ebp)
    return listelm->prev;
  106c6b:	8b 45 ac             	mov    -0x54(%ebp),%eax
  106c6e:	8b 00                	mov    (%eax),%eax
  106c70:	89 45 c8             	mov    %eax,-0x38(%ebp)
  106c73:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  106c76:	8b 45 c8             	mov    -0x38(%ebp),%eax
  106c79:	89 45 c0             	mov    %eax,-0x40(%ebp)
  106c7c:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  106c7f:	89 45 bc             	mov    %eax,-0x44(%ebp)
    __list_add(elm, listelm, listelm->next);
  106c82:	8b 45 c0             	mov    -0x40(%ebp),%eax
  106c85:	8b 40 04             	mov    0x4(%eax),%eax
  106c88:	8b 55 bc             	mov    -0x44(%ebp),%edx
  106c8b:	89 55 b8             	mov    %edx,-0x48(%ebp)
  106c8e:	8b 55 c0             	mov    -0x40(%ebp),%edx
  106c91:	89 55 b4             	mov    %edx,-0x4c(%ebp)
  106c94:	89 45 b0             	mov    %eax,-0x50(%ebp)
    prev->next = next->prev = elm;
  106c97:	8b 45 b0             	mov    -0x50(%ebp),%eax
  106c9a:	8b 55 b8             	mov    -0x48(%ebp),%edx
  106c9d:	89 10                	mov    %edx,(%eax)
  106c9f:	8b 45 b0             	mov    -0x50(%ebp),%eax
  106ca2:	8b 10                	mov    (%eax),%edx
  106ca4:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  106ca7:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  106caa:	8b 45 b8             	mov    -0x48(%ebp),%eax
  106cad:	8b 55 b0             	mov    -0x50(%ebp),%edx
  106cb0:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  106cb3:	8b 45 b8             	mov    -0x48(%ebp),%eax
  106cb6:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  106cb9:	89 10                	mov    %edx,(%eax)
}
  106cbb:	90                   	nop
}
  106cbc:	90                   	nop
}
  106cbd:	90                   	nop
    }
        nr_free -= n;
  106cbe:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  106cc3:	2b 45 08             	sub    0x8(%ebp),%eax
  106cc6:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8
        ClearPageProperty(page);
  106ccb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106cce:	83 c0 04             	add    $0x4,%eax
  106cd1:	c7 45 a8 01 00 00 00 	movl   $0x1,-0x58(%ebp)
  106cd8:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  106cdb:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  106cde:	8b 55 a8             	mov    -0x58(%ebp),%edx
  106ce1:	0f b3 10             	btr    %edx,(%eax)
}
  106ce4:	90                   	nop
    }
    return page;
  106ce5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  106ce8:	c9                   	leave  
  106ce9:	c3                   	ret    

00106cea <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
  106cea:	f3 0f 1e fb          	endbr32 
  106cee:	55                   	push   %ebp
  106cef:	89 e5                	mov    %esp,%ebp
  106cf1:	81 ec a8 00 00 00    	sub    $0xa8,%esp
    assert(n > 0);
  106cf7:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  106cfb:	75 24                	jne    106d21 <default_free_pages+0x37>
  106cfd:	c7 44 24 0c 34 a8 10 	movl   $0x10a834,0xc(%esp)
  106d04:	00 
  106d05:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  106d0c:	00 
  106d0d:	c7 44 24 04 9a 00 00 	movl   $0x9a,0x4(%esp)
  106d14:	00 
  106d15:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  106d1c:	e8 00 97 ff ff       	call   100421 <__panic>
    struct Page *p = base;
  106d21:	8b 45 08             	mov    0x8(%ebp),%eax
  106d24:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
  106d27:	e9 9d 00 00 00       	jmp    106dc9 <default_free_pages+0xdf>
        assert(!PageReserved(p) && !PageProperty(p));
  106d2c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106d2f:	83 c0 04             	add    $0x4,%eax
  106d32:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  106d39:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  106d3c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  106d3f:	8b 55 e8             	mov    -0x18(%ebp),%edx
  106d42:	0f a3 10             	bt     %edx,(%eax)
  106d45:	19 c0                	sbb    %eax,%eax
  106d47:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return oldbit != 0;
  106d4a:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  106d4e:	0f 95 c0             	setne  %al
  106d51:	0f b6 c0             	movzbl %al,%eax
  106d54:	85 c0                	test   %eax,%eax
  106d56:	75 2c                	jne    106d84 <default_free_pages+0x9a>
  106d58:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106d5b:	83 c0 04             	add    $0x4,%eax
  106d5e:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
  106d65:	89 45 d8             	mov    %eax,-0x28(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  106d68:	8b 45 d8             	mov    -0x28(%ebp),%eax
  106d6b:	8b 55 dc             	mov    -0x24(%ebp),%edx
  106d6e:	0f a3 10             	bt     %edx,(%eax)
  106d71:	19 c0                	sbb    %eax,%eax
  106d73:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    return oldbit != 0;
  106d76:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  106d7a:	0f 95 c0             	setne  %al
  106d7d:	0f b6 c0             	movzbl %al,%eax
  106d80:	85 c0                	test   %eax,%eax
  106d82:	74 24                	je     106da8 <default_free_pages+0xbe>
  106d84:	c7 44 24 0c 78 a8 10 	movl   $0x10a878,0xc(%esp)
  106d8b:	00 
  106d8c:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  106d93:	00 
  106d94:	c7 44 24 04 9d 00 00 	movl   $0x9d,0x4(%esp)
  106d9b:	00 
  106d9c:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  106da3:	e8 79 96 ff ff       	call   100421 <__panic>
        p->flags = 0;
  106da8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106dab:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);
  106db2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  106db9:	00 
  106dba:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106dbd:	89 04 24             	mov    %eax,(%esp)
  106dc0:	e8 be fb ff ff       	call   106983 <set_page_ref>
    for (; p != base + n; p ++) {
  106dc5:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
  106dc9:	8b 55 0c             	mov    0xc(%ebp),%edx
  106dcc:	89 d0                	mov    %edx,%eax
  106dce:	c1 e0 03             	shl    $0x3,%eax
  106dd1:	01 d0                	add    %edx,%eax
  106dd3:	c1 e0 02             	shl    $0x2,%eax
  106dd6:	89 c2                	mov    %eax,%edx
  106dd8:	8b 45 08             	mov    0x8(%ebp),%eax
  106ddb:	01 d0                	add    %edx,%eax
  106ddd:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  106de0:	0f 85 46 ff ff ff    	jne    106d2c <default_free_pages+0x42>
    }
    base->property = n;
  106de6:	8b 45 08             	mov    0x8(%ebp),%eax
  106de9:	8b 55 0c             	mov    0xc(%ebp),%edx
  106dec:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
  106def:	8b 45 08             	mov    0x8(%ebp),%eax
  106df2:	83 c0 04             	add    $0x4,%eax
  106df5:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
  106dfc:	89 45 c8             	mov    %eax,-0x38(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  106dff:	8b 45 c8             	mov    -0x38(%ebp),%eax
  106e02:	8b 55 cc             	mov    -0x34(%ebp),%edx
  106e05:	0f ab 10             	bts    %edx,(%eax)
}
  106e08:	90                   	nop
  106e09:	c7 45 d0 e0 33 1c 00 	movl   $0x1c33e0,-0x30(%ebp)
    return listelm->next;
  106e10:	8b 45 d0             	mov    -0x30(%ebp),%eax
  106e13:	8b 40 04             	mov    0x4(%eax),%eax
    list_entry_t *le = list_next(&free_list);
  106e16:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list) {
  106e19:	e9 0e 01 00 00       	jmp    106f2c <default_free_pages+0x242>
        p = le2page(le, page_link);
  106e1e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  106e21:	83 e8 0c             	sub    $0xc,%eax
  106e24:	89 45 f4             	mov    %eax,-0xc(%ebp)
  106e27:	8b 45 f0             	mov    -0x10(%ebp),%eax
  106e2a:	89 45 c4             	mov    %eax,-0x3c(%ebp)
  106e2d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  106e30:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
  106e33:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (base + base->property == p) {
  106e36:	8b 45 08             	mov    0x8(%ebp),%eax
  106e39:	8b 50 08             	mov    0x8(%eax),%edx
  106e3c:	89 d0                	mov    %edx,%eax
  106e3e:	c1 e0 03             	shl    $0x3,%eax
  106e41:	01 d0                	add    %edx,%eax
  106e43:	c1 e0 02             	shl    $0x2,%eax
  106e46:	89 c2                	mov    %eax,%edx
  106e48:	8b 45 08             	mov    0x8(%ebp),%eax
  106e4b:	01 d0                	add    %edx,%eax
  106e4d:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  106e50:	75 5d                	jne    106eaf <default_free_pages+0x1c5>
            base->property += p->property;
  106e52:	8b 45 08             	mov    0x8(%ebp),%eax
  106e55:	8b 50 08             	mov    0x8(%eax),%edx
  106e58:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106e5b:	8b 40 08             	mov    0x8(%eax),%eax
  106e5e:	01 c2                	add    %eax,%edx
  106e60:	8b 45 08             	mov    0x8(%ebp),%eax
  106e63:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(p);
  106e66:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106e69:	83 c0 04             	add    $0x4,%eax
  106e6c:	c7 45 b4 01 00 00 00 	movl   $0x1,-0x4c(%ebp)
  106e73:	89 45 b0             	mov    %eax,-0x50(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  106e76:	8b 45 b0             	mov    -0x50(%ebp),%eax
  106e79:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  106e7c:	0f b3 10             	btr    %edx,(%eax)
}
  106e7f:	90                   	nop
            list_del(&(p->page_link));
  106e80:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106e83:	83 c0 0c             	add    $0xc,%eax
  106e86:	89 45 c0             	mov    %eax,-0x40(%ebp)
    __list_del(listelm->prev, listelm->next);
  106e89:	8b 45 c0             	mov    -0x40(%ebp),%eax
  106e8c:	8b 40 04             	mov    0x4(%eax),%eax
  106e8f:	8b 55 c0             	mov    -0x40(%ebp),%edx
  106e92:	8b 12                	mov    (%edx),%edx
  106e94:	89 55 bc             	mov    %edx,-0x44(%ebp)
  106e97:	89 45 b8             	mov    %eax,-0x48(%ebp)
    prev->next = next;
  106e9a:	8b 45 bc             	mov    -0x44(%ebp),%eax
  106e9d:	8b 55 b8             	mov    -0x48(%ebp),%edx
  106ea0:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  106ea3:	8b 45 b8             	mov    -0x48(%ebp),%eax
  106ea6:	8b 55 bc             	mov    -0x44(%ebp),%edx
  106ea9:	89 10                	mov    %edx,(%eax)
}
  106eab:	90                   	nop
}
  106eac:	90                   	nop
  106ead:	eb 7d                	jmp    106f2c <default_free_pages+0x242>
        }
        else if (p + p->property == base) {
  106eaf:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106eb2:	8b 50 08             	mov    0x8(%eax),%edx
  106eb5:	89 d0                	mov    %edx,%eax
  106eb7:	c1 e0 03             	shl    $0x3,%eax
  106eba:	01 d0                	add    %edx,%eax
  106ebc:	c1 e0 02             	shl    $0x2,%eax
  106ebf:	89 c2                	mov    %eax,%edx
  106ec1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106ec4:	01 d0                	add    %edx,%eax
  106ec6:	39 45 08             	cmp    %eax,0x8(%ebp)
  106ec9:	75 61                	jne    106f2c <default_free_pages+0x242>
            p->property += base->property;
  106ecb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106ece:	8b 50 08             	mov    0x8(%eax),%edx
  106ed1:	8b 45 08             	mov    0x8(%ebp),%eax
  106ed4:	8b 40 08             	mov    0x8(%eax),%eax
  106ed7:	01 c2                	add    %eax,%edx
  106ed9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106edc:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(base);
  106edf:	8b 45 08             	mov    0x8(%ebp),%eax
  106ee2:	83 c0 04             	add    $0x4,%eax
  106ee5:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
  106eec:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  106eef:	8b 45 9c             	mov    -0x64(%ebp),%eax
  106ef2:	8b 55 a0             	mov    -0x60(%ebp),%edx
  106ef5:	0f b3 10             	btr    %edx,(%eax)
}
  106ef8:	90                   	nop
            base = p;
  106ef9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106efc:	89 45 08             	mov    %eax,0x8(%ebp)
            list_del(&(p->page_link));
  106eff:	8b 45 f4             	mov    -0xc(%ebp),%eax
  106f02:	83 c0 0c             	add    $0xc,%eax
  106f05:	89 45 ac             	mov    %eax,-0x54(%ebp)
    __list_del(listelm->prev, listelm->next);
  106f08:	8b 45 ac             	mov    -0x54(%ebp),%eax
  106f0b:	8b 40 04             	mov    0x4(%eax),%eax
  106f0e:	8b 55 ac             	mov    -0x54(%ebp),%edx
  106f11:	8b 12                	mov    (%edx),%edx
  106f13:	89 55 a8             	mov    %edx,-0x58(%ebp)
  106f16:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    prev->next = next;
  106f19:	8b 45 a8             	mov    -0x58(%ebp),%eax
  106f1c:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  106f1f:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  106f22:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  106f25:	8b 55 a8             	mov    -0x58(%ebp),%edx
  106f28:	89 10                	mov    %edx,(%eax)
}
  106f2a:	90                   	nop
}
  106f2b:	90                   	nop
    while (le != &free_list) {
  106f2c:	81 7d f0 e0 33 1c 00 	cmpl   $0x1c33e0,-0x10(%ebp)
  106f33:	0f 85 e5 fe ff ff    	jne    106e1e <default_free_pages+0x134>
        }
    }
    nr_free += n;
  106f39:	8b 15 e8 33 1c 00    	mov    0x1c33e8,%edx
  106f3f:	8b 45 0c             	mov    0xc(%ebp),%eax
  106f42:	01 d0                	add    %edx,%eax
  106f44:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8
  106f49:	c7 45 98 e0 33 1c 00 	movl   $0x1c33e0,-0x68(%ebp)
    return listelm->next;
  106f50:	8b 45 98             	mov    -0x68(%ebp),%eax
  106f53:	8b 40 04             	mov    0x4(%eax),%eax
    struct list_entry_t* it;
    for(it=list_next(&free_list);it!=&free_list && le2page(it,page_link)->property < base->property;it=list_next(it));
  106f56:	89 45 ec             	mov    %eax,-0x14(%ebp)
  106f59:	eb 0f                	jmp    106f6a <default_free_pages+0x280>
  106f5b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106f5e:	89 45 94             	mov    %eax,-0x6c(%ebp)
  106f61:	8b 45 94             	mov    -0x6c(%ebp),%eax
  106f64:	8b 40 04             	mov    0x4(%eax),%eax
  106f67:	89 45 ec             	mov    %eax,-0x14(%ebp)
  106f6a:	81 7d ec e0 33 1c 00 	cmpl   $0x1c33e0,-0x14(%ebp)
  106f71:	74 13                	je     106f86 <default_free_pages+0x29c>
  106f73:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106f76:	83 e8 0c             	sub    $0xc,%eax
  106f79:	8b 50 08             	mov    0x8(%eax),%edx
  106f7c:	8b 45 08             	mov    0x8(%ebp),%eax
  106f7f:	8b 40 08             	mov    0x8(%eax),%eax
  106f82:	39 c2                	cmp    %eax,%edx
  106f84:	72 d5                	jb     106f5b <default_free_pages+0x271>
    {
    	//cprintf("%d %d \n",le2page(it,page_link)->property , base->property);
    }
    list_add(list_prev(it), &(base->page_link));
  106f86:	8b 45 08             	mov    0x8(%ebp),%eax
  106f89:	8d 50 0c             	lea    0xc(%eax),%edx
  106f8c:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106f8f:	89 85 74 ff ff ff    	mov    %eax,-0x8c(%ebp)
    return listelm->prev;
  106f95:	8b 85 74 ff ff ff    	mov    -0x8c(%ebp),%eax
  106f9b:	8b 00                	mov    (%eax),%eax
  106f9d:	89 45 90             	mov    %eax,-0x70(%ebp)
  106fa0:	89 55 8c             	mov    %edx,-0x74(%ebp)
  106fa3:	8b 45 90             	mov    -0x70(%ebp),%eax
  106fa6:	89 45 88             	mov    %eax,-0x78(%ebp)
  106fa9:	8b 45 8c             	mov    -0x74(%ebp),%eax
  106fac:	89 45 84             	mov    %eax,-0x7c(%ebp)
    __list_add(elm, listelm, listelm->next);
  106faf:	8b 45 88             	mov    -0x78(%ebp),%eax
  106fb2:	8b 40 04             	mov    0x4(%eax),%eax
  106fb5:	8b 55 84             	mov    -0x7c(%ebp),%edx
  106fb8:	89 55 80             	mov    %edx,-0x80(%ebp)
  106fbb:	8b 55 88             	mov    -0x78(%ebp),%edx
  106fbe:	89 95 7c ff ff ff    	mov    %edx,-0x84(%ebp)
  106fc4:	89 85 78 ff ff ff    	mov    %eax,-0x88(%ebp)
    prev->next = next->prev = elm;
  106fca:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
  106fd0:	8b 55 80             	mov    -0x80(%ebp),%edx
  106fd3:	89 10                	mov    %edx,(%eax)
  106fd5:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
  106fdb:	8b 10                	mov    (%eax),%edx
  106fdd:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
  106fe3:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  106fe6:	8b 45 80             	mov    -0x80(%ebp),%eax
  106fe9:	8b 95 78 ff ff ff    	mov    -0x88(%ebp),%edx
  106fef:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  106ff2:	8b 45 80             	mov    -0x80(%ebp),%eax
  106ff5:	8b 95 7c ff ff ff    	mov    -0x84(%ebp),%edx
  106ffb:	89 10                	mov    %edx,(%eax)
}
  106ffd:	90                   	nop
}
  106ffe:	90                   	nop
}
  106fff:	90                   	nop
}
  107000:	90                   	nop
  107001:	c9                   	leave  
  107002:	c3                   	ret    

00107003 <default_nr_free_pages>:

static size_t
default_nr_free_pages(void) {
  107003:	f3 0f 1e fb          	endbr32 
  107007:	55                   	push   %ebp
  107008:	89 e5                	mov    %esp,%ebp
    return nr_free;
  10700a:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
}
  10700f:	5d                   	pop    %ebp
  107010:	c3                   	ret    

00107011 <basic_check>:

static void
basic_check(void) {
  107011:	f3 0f 1e fb          	endbr32 
  107015:	55                   	push   %ebp
  107016:	89 e5                	mov    %esp,%ebp
  107018:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
  10701b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  107022:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107025:	89 45 f0             	mov    %eax,-0x10(%ebp)
  107028:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10702b:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
  10702e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  107035:	e8 9d cd ff ff       	call   103dd7 <alloc_pages>
  10703a:	89 45 ec             	mov    %eax,-0x14(%ebp)
  10703d:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  107041:	75 24                	jne    107067 <basic_check+0x56>
  107043:	c7 44 24 0c 9d a8 10 	movl   $0x10a89d,0xc(%esp)
  10704a:	00 
  10704b:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107052:	00 
  107053:	c7 44 24 04 c5 00 00 	movl   $0xc5,0x4(%esp)
  10705a:	00 
  10705b:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107062:	e8 ba 93 ff ff       	call   100421 <__panic>
    assert((p1 = alloc_page()) != NULL);
  107067:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10706e:	e8 64 cd ff ff       	call   103dd7 <alloc_pages>
  107073:	89 45 f0             	mov    %eax,-0x10(%ebp)
  107076:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  10707a:	75 24                	jne    1070a0 <basic_check+0x8f>
  10707c:	c7 44 24 0c b9 a8 10 	movl   $0x10a8b9,0xc(%esp)
  107083:	00 
  107084:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10708b:	00 
  10708c:	c7 44 24 04 c6 00 00 	movl   $0xc6,0x4(%esp)
  107093:	00 
  107094:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10709b:	e8 81 93 ff ff       	call   100421 <__panic>
    assert((p2 = alloc_page()) != NULL);
  1070a0:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1070a7:	e8 2b cd ff ff       	call   103dd7 <alloc_pages>
  1070ac:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1070af:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1070b3:	75 24                	jne    1070d9 <basic_check+0xc8>
  1070b5:	c7 44 24 0c d5 a8 10 	movl   $0x10a8d5,0xc(%esp)
  1070bc:	00 
  1070bd:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1070c4:	00 
  1070c5:	c7 44 24 04 c7 00 00 	movl   $0xc7,0x4(%esp)
  1070cc:	00 
  1070cd:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1070d4:	e8 48 93 ff ff       	call   100421 <__panic>

    assert(p0 != p1 && p0 != p2 && p1 != p2);
  1070d9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1070dc:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  1070df:	74 10                	je     1070f1 <basic_check+0xe0>
  1070e1:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1070e4:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  1070e7:	74 08                	je     1070f1 <basic_check+0xe0>
  1070e9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1070ec:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  1070ef:	75 24                	jne    107115 <basic_check+0x104>
  1070f1:	c7 44 24 0c f4 a8 10 	movl   $0x10a8f4,0xc(%esp)
  1070f8:	00 
  1070f9:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107100:	00 
  107101:	c7 44 24 04 c9 00 00 	movl   $0xc9,0x4(%esp)
  107108:	00 
  107109:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107110:	e8 0c 93 ff ff       	call   100421 <__panic>
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
  107115:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107118:	89 04 24             	mov    %eax,(%esp)
  10711b:	e8 59 f8 ff ff       	call   106979 <page_ref>
  107120:	85 c0                	test   %eax,%eax
  107122:	75 1e                	jne    107142 <basic_check+0x131>
  107124:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107127:	89 04 24             	mov    %eax,(%esp)
  10712a:	e8 4a f8 ff ff       	call   106979 <page_ref>
  10712f:	85 c0                	test   %eax,%eax
  107131:	75 0f                	jne    107142 <basic_check+0x131>
  107133:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107136:	89 04 24             	mov    %eax,(%esp)
  107139:	e8 3b f8 ff ff       	call   106979 <page_ref>
  10713e:	85 c0                	test   %eax,%eax
  107140:	74 24                	je     107166 <basic_check+0x155>
  107142:	c7 44 24 0c 18 a9 10 	movl   $0x10a918,0xc(%esp)
  107149:	00 
  10714a:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107151:	00 
  107152:	c7 44 24 04 ca 00 00 	movl   $0xca,0x4(%esp)
  107159:	00 
  10715a:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107161:	e8 bb 92 ff ff       	call   100421 <__panic>

    assert(page2pa(p0) < npage * PGSIZE);
  107166:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107169:	89 04 24             	mov    %eax,(%esp)
  10716c:	e8 f2 f7 ff ff       	call   106963 <page2pa>
  107171:	8b 15 80 6e 12 00    	mov    0x126e80,%edx
  107177:	c1 e2 0c             	shl    $0xc,%edx
  10717a:	39 d0                	cmp    %edx,%eax
  10717c:	72 24                	jb     1071a2 <basic_check+0x191>
  10717e:	c7 44 24 0c 54 a9 10 	movl   $0x10a954,0xc(%esp)
  107185:	00 
  107186:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10718d:	00 
  10718e:	c7 44 24 04 cc 00 00 	movl   $0xcc,0x4(%esp)
  107195:	00 
  107196:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10719d:	e8 7f 92 ff ff       	call   100421 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
  1071a2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1071a5:	89 04 24             	mov    %eax,(%esp)
  1071a8:	e8 b6 f7 ff ff       	call   106963 <page2pa>
  1071ad:	8b 15 80 6e 12 00    	mov    0x126e80,%edx
  1071b3:	c1 e2 0c             	shl    $0xc,%edx
  1071b6:	39 d0                	cmp    %edx,%eax
  1071b8:	72 24                	jb     1071de <basic_check+0x1cd>
  1071ba:	c7 44 24 0c 71 a9 10 	movl   $0x10a971,0xc(%esp)
  1071c1:	00 
  1071c2:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1071c9:	00 
  1071ca:	c7 44 24 04 cd 00 00 	movl   $0xcd,0x4(%esp)
  1071d1:	00 
  1071d2:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1071d9:	e8 43 92 ff ff       	call   100421 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
  1071de:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1071e1:	89 04 24             	mov    %eax,(%esp)
  1071e4:	e8 7a f7 ff ff       	call   106963 <page2pa>
  1071e9:	8b 15 80 6e 12 00    	mov    0x126e80,%edx
  1071ef:	c1 e2 0c             	shl    $0xc,%edx
  1071f2:	39 d0                	cmp    %edx,%eax
  1071f4:	72 24                	jb     10721a <basic_check+0x209>
  1071f6:	c7 44 24 0c 8e a9 10 	movl   $0x10a98e,0xc(%esp)
  1071fd:	00 
  1071fe:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107205:	00 
  107206:	c7 44 24 04 ce 00 00 	movl   $0xce,0x4(%esp)
  10720d:	00 
  10720e:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107215:	e8 07 92 ff ff       	call   100421 <__panic>

    list_entry_t free_list_store = free_list;
  10721a:	a1 e0 33 1c 00       	mov    0x1c33e0,%eax
  10721f:	8b 15 e4 33 1c 00    	mov    0x1c33e4,%edx
  107225:	89 45 d0             	mov    %eax,-0x30(%ebp)
  107228:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  10722b:	c7 45 dc e0 33 1c 00 	movl   $0x1c33e0,-0x24(%ebp)
    elm->prev = elm->next = elm;
  107232:	8b 45 dc             	mov    -0x24(%ebp),%eax
  107235:	8b 55 dc             	mov    -0x24(%ebp),%edx
  107238:	89 50 04             	mov    %edx,0x4(%eax)
  10723b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10723e:	8b 50 04             	mov    0x4(%eax),%edx
  107241:	8b 45 dc             	mov    -0x24(%ebp),%eax
  107244:	89 10                	mov    %edx,(%eax)
}
  107246:	90                   	nop
  107247:	c7 45 e0 e0 33 1c 00 	movl   $0x1c33e0,-0x20(%ebp)
    return list->next == list;
  10724e:	8b 45 e0             	mov    -0x20(%ebp),%eax
  107251:	8b 40 04             	mov    0x4(%eax),%eax
  107254:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  107257:	0f 94 c0             	sete   %al
  10725a:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
  10725d:	85 c0                	test   %eax,%eax
  10725f:	75 24                	jne    107285 <basic_check+0x274>
  107261:	c7 44 24 0c ab a9 10 	movl   $0x10a9ab,0xc(%esp)
  107268:	00 
  107269:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107270:	00 
  107271:	c7 44 24 04 d2 00 00 	movl   $0xd2,0x4(%esp)
  107278:	00 
  107279:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107280:	e8 9c 91 ff ff       	call   100421 <__panic>

    unsigned int nr_free_store = nr_free;
  107285:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  10728a:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;
  10728d:	c7 05 e8 33 1c 00 00 	movl   $0x0,0x1c33e8
  107294:	00 00 00 

    assert(alloc_page() == NULL);
  107297:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10729e:	e8 34 cb ff ff       	call   103dd7 <alloc_pages>
  1072a3:	85 c0                	test   %eax,%eax
  1072a5:	74 24                	je     1072cb <basic_check+0x2ba>
  1072a7:	c7 44 24 0c c2 a9 10 	movl   $0x10a9c2,0xc(%esp)
  1072ae:	00 
  1072af:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1072b6:	00 
  1072b7:	c7 44 24 04 d7 00 00 	movl   $0xd7,0x4(%esp)
  1072be:	00 
  1072bf:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1072c6:	e8 56 91 ff ff       	call   100421 <__panic>

    free_page(p0);
  1072cb:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1072d2:	00 
  1072d3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1072d6:	89 04 24             	mov    %eax,(%esp)
  1072d9:	e8 35 cb ff ff       	call   103e13 <free_pages>
    free_page(p1);
  1072de:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1072e5:	00 
  1072e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1072e9:	89 04 24             	mov    %eax,(%esp)
  1072ec:	e8 22 cb ff ff       	call   103e13 <free_pages>
    free_page(p2);
  1072f1:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1072f8:	00 
  1072f9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1072fc:	89 04 24             	mov    %eax,(%esp)
  1072ff:	e8 0f cb ff ff       	call   103e13 <free_pages>
    assert(nr_free == 3);
  107304:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  107309:	83 f8 03             	cmp    $0x3,%eax
  10730c:	74 24                	je     107332 <basic_check+0x321>
  10730e:	c7 44 24 0c d7 a9 10 	movl   $0x10a9d7,0xc(%esp)
  107315:	00 
  107316:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10731d:	00 
  10731e:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
  107325:	00 
  107326:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10732d:	e8 ef 90 ff ff       	call   100421 <__panic>

    assert((p0 = alloc_page()) != NULL);
  107332:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  107339:	e8 99 ca ff ff       	call   103dd7 <alloc_pages>
  10733e:	89 45 ec             	mov    %eax,-0x14(%ebp)
  107341:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  107345:	75 24                	jne    10736b <basic_check+0x35a>
  107347:	c7 44 24 0c 9d a8 10 	movl   $0x10a89d,0xc(%esp)
  10734e:	00 
  10734f:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107356:	00 
  107357:	c7 44 24 04 de 00 00 	movl   $0xde,0x4(%esp)
  10735e:	00 
  10735f:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107366:	e8 b6 90 ff ff       	call   100421 <__panic>
    assert((p1 = alloc_page()) != NULL);
  10736b:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  107372:	e8 60 ca ff ff       	call   103dd7 <alloc_pages>
  107377:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10737a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  10737e:	75 24                	jne    1073a4 <basic_check+0x393>
  107380:	c7 44 24 0c b9 a8 10 	movl   $0x10a8b9,0xc(%esp)
  107387:	00 
  107388:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10738f:	00 
  107390:	c7 44 24 04 df 00 00 	movl   $0xdf,0x4(%esp)
  107397:	00 
  107398:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10739f:	e8 7d 90 ff ff       	call   100421 <__panic>
    assert((p2 = alloc_page()) != NULL);
  1073a4:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1073ab:	e8 27 ca ff ff       	call   103dd7 <alloc_pages>
  1073b0:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1073b3:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1073b7:	75 24                	jne    1073dd <basic_check+0x3cc>
  1073b9:	c7 44 24 0c d5 a8 10 	movl   $0x10a8d5,0xc(%esp)
  1073c0:	00 
  1073c1:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1073c8:	00 
  1073c9:	c7 44 24 04 e0 00 00 	movl   $0xe0,0x4(%esp)
  1073d0:	00 
  1073d1:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1073d8:	e8 44 90 ff ff       	call   100421 <__panic>

    assert(alloc_page() == NULL);
  1073dd:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1073e4:	e8 ee c9 ff ff       	call   103dd7 <alloc_pages>
  1073e9:	85 c0                	test   %eax,%eax
  1073eb:	74 24                	je     107411 <basic_check+0x400>
  1073ed:	c7 44 24 0c c2 a9 10 	movl   $0x10a9c2,0xc(%esp)
  1073f4:	00 
  1073f5:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1073fc:	00 
  1073fd:	c7 44 24 04 e2 00 00 	movl   $0xe2,0x4(%esp)
  107404:	00 
  107405:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10740c:	e8 10 90 ff ff       	call   100421 <__panic>

    free_page(p0);
  107411:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  107418:	00 
  107419:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10741c:	89 04 24             	mov    %eax,(%esp)
  10741f:	e8 ef c9 ff ff       	call   103e13 <free_pages>
  107424:	c7 45 d8 e0 33 1c 00 	movl   $0x1c33e0,-0x28(%ebp)
  10742b:	8b 45 d8             	mov    -0x28(%ebp),%eax
  10742e:	8b 40 04             	mov    0x4(%eax),%eax
  107431:	39 45 d8             	cmp    %eax,-0x28(%ebp)
  107434:	0f 94 c0             	sete   %al
  107437:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));
  10743a:	85 c0                	test   %eax,%eax
  10743c:	74 24                	je     107462 <basic_check+0x451>
  10743e:	c7 44 24 0c e4 a9 10 	movl   $0x10a9e4,0xc(%esp)
  107445:	00 
  107446:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10744d:	00 
  10744e:	c7 44 24 04 e5 00 00 	movl   $0xe5,0x4(%esp)
  107455:	00 
  107456:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10745d:	e8 bf 8f ff ff       	call   100421 <__panic>

    struct Page *p;
    assert((p = alloc_page()) == p0);
  107462:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  107469:	e8 69 c9 ff ff       	call   103dd7 <alloc_pages>
  10746e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  107471:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  107474:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  107477:	74 24                	je     10749d <basic_check+0x48c>
  107479:	c7 44 24 0c fc a9 10 	movl   $0x10a9fc,0xc(%esp)
  107480:	00 
  107481:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107488:	00 
  107489:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
  107490:	00 
  107491:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107498:	e8 84 8f ff ff       	call   100421 <__panic>
    assert(alloc_page() == NULL);
  10749d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1074a4:	e8 2e c9 ff ff       	call   103dd7 <alloc_pages>
  1074a9:	85 c0                	test   %eax,%eax
  1074ab:	74 24                	je     1074d1 <basic_check+0x4c0>
  1074ad:	c7 44 24 0c c2 a9 10 	movl   $0x10a9c2,0xc(%esp)
  1074b4:	00 
  1074b5:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1074bc:	00 
  1074bd:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
  1074c4:	00 
  1074c5:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1074cc:	e8 50 8f ff ff       	call   100421 <__panic>

    assert(nr_free == 0);
  1074d1:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  1074d6:	85 c0                	test   %eax,%eax
  1074d8:	74 24                	je     1074fe <basic_check+0x4ed>
  1074da:	c7 44 24 0c 15 aa 10 	movl   $0x10aa15,0xc(%esp)
  1074e1:	00 
  1074e2:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1074e9:	00 
  1074ea:	c7 44 24 04 eb 00 00 	movl   $0xeb,0x4(%esp)
  1074f1:	00 
  1074f2:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1074f9:	e8 23 8f ff ff       	call   100421 <__panic>
    free_list = free_list_store;
  1074fe:	8b 45 d0             	mov    -0x30(%ebp),%eax
  107501:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  107504:	a3 e0 33 1c 00       	mov    %eax,0x1c33e0
  107509:	89 15 e4 33 1c 00    	mov    %edx,0x1c33e4
    nr_free = nr_free_store;
  10750f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  107512:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8

    free_page(p);
  107517:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10751e:	00 
  10751f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  107522:	89 04 24             	mov    %eax,(%esp)
  107525:	e8 e9 c8 ff ff       	call   103e13 <free_pages>
    free_page(p1);
  10752a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  107531:	00 
  107532:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107535:	89 04 24             	mov    %eax,(%esp)
  107538:	e8 d6 c8 ff ff       	call   103e13 <free_pages>
    free_page(p2);
  10753d:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  107544:	00 
  107545:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107548:	89 04 24             	mov    %eax,(%esp)
  10754b:	e8 c3 c8 ff ff       	call   103e13 <free_pages>
}
  107550:	90                   	nop
  107551:	c9                   	leave  
  107552:	c3                   	ret    

00107553 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
  107553:	f3 0f 1e fb          	endbr32 
  107557:	55                   	push   %ebp
  107558:	89 e5                	mov    %esp,%ebp
  10755a:	81 ec 98 00 00 00    	sub    $0x98,%esp
    int count = 0, total = 0;
  107560:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  107567:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
  10756e:	c7 45 ec e0 33 1c 00 	movl   $0x1c33e0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
  107575:	eb 6a                	jmp    1075e1 <default_check+0x8e>
        struct Page *p = le2page(le, page_link);
  107577:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10757a:	83 e8 0c             	sub    $0xc,%eax
  10757d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(PageProperty(p));
  107580:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  107583:	83 c0 04             	add    $0x4,%eax
  107586:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
  10758d:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  107590:	8b 45 cc             	mov    -0x34(%ebp),%eax
  107593:	8b 55 d0             	mov    -0x30(%ebp),%edx
  107596:	0f a3 10             	bt     %edx,(%eax)
  107599:	19 c0                	sbb    %eax,%eax
  10759b:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
  10759e:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  1075a2:	0f 95 c0             	setne  %al
  1075a5:	0f b6 c0             	movzbl %al,%eax
  1075a8:	85 c0                	test   %eax,%eax
  1075aa:	75 24                	jne    1075d0 <default_check+0x7d>
  1075ac:	c7 44 24 0c 22 aa 10 	movl   $0x10aa22,0xc(%esp)
  1075b3:	00 
  1075b4:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1075bb:	00 
  1075bc:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
  1075c3:	00 
  1075c4:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1075cb:	e8 51 8e ff ff       	call   100421 <__panic>
        count ++, total += p->property;
  1075d0:	ff 45 f4             	incl   -0xc(%ebp)
  1075d3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1075d6:	8b 50 08             	mov    0x8(%eax),%edx
  1075d9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1075dc:	01 d0                	add    %edx,%eax
  1075de:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1075e1:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1075e4:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
  1075e7:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  1075ea:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
  1075ed:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1075f0:	81 7d ec e0 33 1c 00 	cmpl   $0x1c33e0,-0x14(%ebp)
  1075f7:	0f 85 7a ff ff ff    	jne    107577 <default_check+0x24>
    }
    assert(total == nr_free_pages());
  1075fd:	e8 48 c8 ff ff       	call   103e4a <nr_free_pages>
  107602:	8b 55 f0             	mov    -0x10(%ebp),%edx
  107605:	39 d0                	cmp    %edx,%eax
  107607:	74 24                	je     10762d <default_check+0xda>
  107609:	c7 44 24 0c 32 aa 10 	movl   $0x10aa32,0xc(%esp)
  107610:	00 
  107611:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107618:	00 
  107619:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
  107620:	00 
  107621:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107628:	e8 f4 8d ff ff       	call   100421 <__panic>

    basic_check();
  10762d:	e8 df f9 ff ff       	call   107011 <basic_check>

    struct Page *p0 = alloc_pages(5), *p1, *p2;
  107632:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  107639:	e8 99 c7 ff ff       	call   103dd7 <alloc_pages>
  10763e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(p0 != NULL);
  107641:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  107645:	75 24                	jne    10766b <default_check+0x118>
  107647:	c7 44 24 0c 4b aa 10 	movl   $0x10aa4b,0xc(%esp)
  10764e:	00 
  10764f:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107656:	00 
  107657:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
  10765e:	00 
  10765f:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107666:	e8 b6 8d ff ff       	call   100421 <__panic>
    assert(!PageProperty(p0));
  10766b:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10766e:	83 c0 04             	add    $0x4,%eax
  107671:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
  107678:	89 45 bc             	mov    %eax,-0x44(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  10767b:	8b 45 bc             	mov    -0x44(%ebp),%eax
  10767e:	8b 55 c0             	mov    -0x40(%ebp),%edx
  107681:	0f a3 10             	bt     %edx,(%eax)
  107684:	19 c0                	sbb    %eax,%eax
  107686:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
  107689:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
  10768d:	0f 95 c0             	setne  %al
  107690:	0f b6 c0             	movzbl %al,%eax
  107693:	85 c0                	test   %eax,%eax
  107695:	74 24                	je     1076bb <default_check+0x168>
  107697:	c7 44 24 0c 56 aa 10 	movl   $0x10aa56,0xc(%esp)
  10769e:	00 
  10769f:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1076a6:	00 
  1076a7:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
  1076ae:	00 
  1076af:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1076b6:	e8 66 8d ff ff       	call   100421 <__panic>

    list_entry_t free_list_store = free_list;
  1076bb:	a1 e0 33 1c 00       	mov    0x1c33e0,%eax
  1076c0:	8b 15 e4 33 1c 00    	mov    0x1c33e4,%edx
  1076c6:	89 45 80             	mov    %eax,-0x80(%ebp)
  1076c9:	89 55 84             	mov    %edx,-0x7c(%ebp)
  1076cc:	c7 45 b0 e0 33 1c 00 	movl   $0x1c33e0,-0x50(%ebp)
    elm->prev = elm->next = elm;
  1076d3:	8b 45 b0             	mov    -0x50(%ebp),%eax
  1076d6:	8b 55 b0             	mov    -0x50(%ebp),%edx
  1076d9:	89 50 04             	mov    %edx,0x4(%eax)
  1076dc:	8b 45 b0             	mov    -0x50(%ebp),%eax
  1076df:	8b 50 04             	mov    0x4(%eax),%edx
  1076e2:	8b 45 b0             	mov    -0x50(%ebp),%eax
  1076e5:	89 10                	mov    %edx,(%eax)
}
  1076e7:	90                   	nop
  1076e8:	c7 45 b4 e0 33 1c 00 	movl   $0x1c33e0,-0x4c(%ebp)
    return list->next == list;
  1076ef:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  1076f2:	8b 40 04             	mov    0x4(%eax),%eax
  1076f5:	39 45 b4             	cmp    %eax,-0x4c(%ebp)
  1076f8:	0f 94 c0             	sete   %al
  1076fb:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
  1076fe:	85 c0                	test   %eax,%eax
  107700:	75 24                	jne    107726 <default_check+0x1d3>
  107702:	c7 44 24 0c ab a9 10 	movl   $0x10a9ab,0xc(%esp)
  107709:	00 
  10770a:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107711:	00 
  107712:	c7 44 24 04 09 01 00 	movl   $0x109,0x4(%esp)
  107719:	00 
  10771a:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107721:	e8 fb 8c ff ff       	call   100421 <__panic>
    assert(alloc_page() == NULL);
  107726:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10772d:	e8 a5 c6 ff ff       	call   103dd7 <alloc_pages>
  107732:	85 c0                	test   %eax,%eax
  107734:	74 24                	je     10775a <default_check+0x207>
  107736:	c7 44 24 0c c2 a9 10 	movl   $0x10a9c2,0xc(%esp)
  10773d:	00 
  10773e:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107745:	00 
  107746:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
  10774d:	00 
  10774e:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107755:	e8 c7 8c ff ff       	call   100421 <__panic>

    unsigned int nr_free_store = nr_free;
  10775a:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  10775f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;
  107762:	c7 05 e8 33 1c 00 00 	movl   $0x0,0x1c33e8
  107769:	00 00 00 

    free_pages(p0 + 2, 3);
  10776c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10776f:	83 c0 48             	add    $0x48,%eax
  107772:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  107779:	00 
  10777a:	89 04 24             	mov    %eax,(%esp)
  10777d:	e8 91 c6 ff ff       	call   103e13 <free_pages>
    assert(alloc_pages(4) == NULL);
  107782:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  107789:	e8 49 c6 ff ff       	call   103dd7 <alloc_pages>
  10778e:	85 c0                	test   %eax,%eax
  107790:	74 24                	je     1077b6 <default_check+0x263>
  107792:	c7 44 24 0c 68 aa 10 	movl   $0x10aa68,0xc(%esp)
  107799:	00 
  10779a:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1077a1:	00 
  1077a2:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
  1077a9:	00 
  1077aa:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1077b1:	e8 6b 8c ff ff       	call   100421 <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);
  1077b6:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1077b9:	83 c0 48             	add    $0x48,%eax
  1077bc:	83 c0 04             	add    $0x4,%eax
  1077bf:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
  1077c6:	89 45 a8             	mov    %eax,-0x58(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1077c9:	8b 45 a8             	mov    -0x58(%ebp),%eax
  1077cc:	8b 55 ac             	mov    -0x54(%ebp),%edx
  1077cf:	0f a3 10             	bt     %edx,(%eax)
  1077d2:	19 c0                	sbb    %eax,%eax
  1077d4:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
  1077d7:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
  1077db:	0f 95 c0             	setne  %al
  1077de:	0f b6 c0             	movzbl %al,%eax
  1077e1:	85 c0                	test   %eax,%eax
  1077e3:	74 0e                	je     1077f3 <default_check+0x2a0>
  1077e5:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1077e8:	83 c0 48             	add    $0x48,%eax
  1077eb:	8b 40 08             	mov    0x8(%eax),%eax
  1077ee:	83 f8 03             	cmp    $0x3,%eax
  1077f1:	74 24                	je     107817 <default_check+0x2c4>
  1077f3:	c7 44 24 0c 80 aa 10 	movl   $0x10aa80,0xc(%esp)
  1077fa:	00 
  1077fb:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107802:	00 
  107803:	c7 44 24 04 11 01 00 	movl   $0x111,0x4(%esp)
  10780a:	00 
  10780b:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107812:	e8 0a 8c ff ff       	call   100421 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
  107817:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  10781e:	e8 b4 c5 ff ff       	call   103dd7 <alloc_pages>
  107823:	89 45 e0             	mov    %eax,-0x20(%ebp)
  107826:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  10782a:	75 24                	jne    107850 <default_check+0x2fd>
  10782c:	c7 44 24 0c ac aa 10 	movl   $0x10aaac,0xc(%esp)
  107833:	00 
  107834:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10783b:	00 
  10783c:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
  107843:	00 
  107844:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10784b:	e8 d1 8b ff ff       	call   100421 <__panic>
    assert(alloc_page() == NULL);
  107850:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  107857:	e8 7b c5 ff ff       	call   103dd7 <alloc_pages>
  10785c:	85 c0                	test   %eax,%eax
  10785e:	74 24                	je     107884 <default_check+0x331>
  107860:	c7 44 24 0c c2 a9 10 	movl   $0x10a9c2,0xc(%esp)
  107867:	00 
  107868:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10786f:	00 
  107870:	c7 44 24 04 13 01 00 	movl   $0x113,0x4(%esp)
  107877:	00 
  107878:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  10787f:	e8 9d 8b ff ff       	call   100421 <__panic>
    assert(p0 + 2 == p1);
  107884:	8b 45 e8             	mov    -0x18(%ebp),%eax
  107887:	83 c0 48             	add    $0x48,%eax
  10788a:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  10788d:	74 24                	je     1078b3 <default_check+0x360>
  10788f:	c7 44 24 0c ca aa 10 	movl   $0x10aaca,0xc(%esp)
  107896:	00 
  107897:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  10789e:	00 
  10789f:	c7 44 24 04 14 01 00 	movl   $0x114,0x4(%esp)
  1078a6:	00 
  1078a7:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1078ae:	e8 6e 8b ff ff       	call   100421 <__panic>

    p2 = p0 + 1;
  1078b3:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1078b6:	83 c0 24             	add    $0x24,%eax
  1078b9:	89 45 dc             	mov    %eax,-0x24(%ebp)
    free_page(p0);
  1078bc:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1078c3:	00 
  1078c4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1078c7:	89 04 24             	mov    %eax,(%esp)
  1078ca:	e8 44 c5 ff ff       	call   103e13 <free_pages>
    free_pages(p1, 3);
  1078cf:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  1078d6:	00 
  1078d7:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1078da:	89 04 24             	mov    %eax,(%esp)
  1078dd:	e8 31 c5 ff ff       	call   103e13 <free_pages>
    assert(PageProperty(p0) && p0->property == 1);
  1078e2:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1078e5:	83 c0 04             	add    $0x4,%eax
  1078e8:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
  1078ef:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1078f2:	8b 45 9c             	mov    -0x64(%ebp),%eax
  1078f5:	8b 55 a0             	mov    -0x60(%ebp),%edx
  1078f8:	0f a3 10             	bt     %edx,(%eax)
  1078fb:	19 c0                	sbb    %eax,%eax
  1078fd:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
  107900:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
  107904:	0f 95 c0             	setne  %al
  107907:	0f b6 c0             	movzbl %al,%eax
  10790a:	85 c0                	test   %eax,%eax
  10790c:	74 0b                	je     107919 <default_check+0x3c6>
  10790e:	8b 45 e8             	mov    -0x18(%ebp),%eax
  107911:	8b 40 08             	mov    0x8(%eax),%eax
  107914:	83 f8 01             	cmp    $0x1,%eax
  107917:	74 24                	je     10793d <default_check+0x3ea>
  107919:	c7 44 24 0c d8 aa 10 	movl   $0x10aad8,0xc(%esp)
  107920:	00 
  107921:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107928:	00 
  107929:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
  107930:	00 
  107931:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107938:	e8 e4 8a ff ff       	call   100421 <__panic>
    assert(PageProperty(p1) && p1->property == 3);
  10793d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  107940:	83 c0 04             	add    $0x4,%eax
  107943:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
  10794a:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  10794d:	8b 45 90             	mov    -0x70(%ebp),%eax
  107950:	8b 55 94             	mov    -0x6c(%ebp),%edx
  107953:	0f a3 10             	bt     %edx,(%eax)
  107956:	19 c0                	sbb    %eax,%eax
  107958:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
  10795b:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
  10795f:	0f 95 c0             	setne  %al
  107962:	0f b6 c0             	movzbl %al,%eax
  107965:	85 c0                	test   %eax,%eax
  107967:	74 0b                	je     107974 <default_check+0x421>
  107969:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10796c:	8b 40 08             	mov    0x8(%eax),%eax
  10796f:	83 f8 03             	cmp    $0x3,%eax
  107972:	74 24                	je     107998 <default_check+0x445>
  107974:	c7 44 24 0c 00 ab 10 	movl   $0x10ab00,0xc(%esp)
  10797b:	00 
  10797c:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107983:	00 
  107984:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
  10798b:	00 
  10798c:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107993:	e8 89 8a ff ff       	call   100421 <__panic>

    assert((p0 = alloc_page()) == p2 - 1);
  107998:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10799f:	e8 33 c4 ff ff       	call   103dd7 <alloc_pages>
  1079a4:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1079a7:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1079aa:	83 e8 24             	sub    $0x24,%eax
  1079ad:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  1079b0:	74 24                	je     1079d6 <default_check+0x483>
  1079b2:	c7 44 24 0c 26 ab 10 	movl   $0x10ab26,0xc(%esp)
  1079b9:	00 
  1079ba:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  1079c1:	00 
  1079c2:	c7 44 24 04 1c 01 00 	movl   $0x11c,0x4(%esp)
  1079c9:	00 
  1079ca:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  1079d1:	e8 4b 8a ff ff       	call   100421 <__panic>
    free_page(p0);
  1079d6:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1079dd:	00 
  1079de:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1079e1:	89 04 24             	mov    %eax,(%esp)
  1079e4:	e8 2a c4 ff ff       	call   103e13 <free_pages>
    assert((p0 = alloc_pages(2)) == p2 + 1);
  1079e9:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  1079f0:	e8 e2 c3 ff ff       	call   103dd7 <alloc_pages>
  1079f5:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1079f8:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1079fb:	83 c0 24             	add    $0x24,%eax
  1079fe:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  107a01:	74 24                	je     107a27 <default_check+0x4d4>
  107a03:	c7 44 24 0c 44 ab 10 	movl   $0x10ab44,0xc(%esp)
  107a0a:	00 
  107a0b:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107a12:	00 
  107a13:	c7 44 24 04 1e 01 00 	movl   $0x11e,0x4(%esp)
  107a1a:	00 
  107a1b:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107a22:	e8 fa 89 ff ff       	call   100421 <__panic>

    free_pages(p0, 2);
  107a27:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  107a2e:	00 
  107a2f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  107a32:	89 04 24             	mov    %eax,(%esp)
  107a35:	e8 d9 c3 ff ff       	call   103e13 <free_pages>
    free_page(p2);
  107a3a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  107a41:	00 
  107a42:	8b 45 dc             	mov    -0x24(%ebp),%eax
  107a45:	89 04 24             	mov    %eax,(%esp)
  107a48:	e8 c6 c3 ff ff       	call   103e13 <free_pages>

    assert((p0 = alloc_pages(5)) != NULL);
  107a4d:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  107a54:	e8 7e c3 ff ff       	call   103dd7 <alloc_pages>
  107a59:	89 45 e8             	mov    %eax,-0x18(%ebp)
  107a5c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  107a60:	75 24                	jne    107a86 <default_check+0x533>
  107a62:	c7 44 24 0c 64 ab 10 	movl   $0x10ab64,0xc(%esp)
  107a69:	00 
  107a6a:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107a71:	00 
  107a72:	c7 44 24 04 23 01 00 	movl   $0x123,0x4(%esp)
  107a79:	00 
  107a7a:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107a81:	e8 9b 89 ff ff       	call   100421 <__panic>
    assert(alloc_page() == NULL);
  107a86:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  107a8d:	e8 45 c3 ff ff       	call   103dd7 <alloc_pages>
  107a92:	85 c0                	test   %eax,%eax
  107a94:	74 24                	je     107aba <default_check+0x567>
  107a96:	c7 44 24 0c c2 a9 10 	movl   $0x10a9c2,0xc(%esp)
  107a9d:	00 
  107a9e:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107aa5:	00 
  107aa6:	c7 44 24 04 24 01 00 	movl   $0x124,0x4(%esp)
  107aad:	00 
  107aae:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107ab5:	e8 67 89 ff ff       	call   100421 <__panic>

    assert(nr_free == 0);
  107aba:	a1 e8 33 1c 00       	mov    0x1c33e8,%eax
  107abf:	85 c0                	test   %eax,%eax
  107ac1:	74 24                	je     107ae7 <default_check+0x594>
  107ac3:	c7 44 24 0c 15 aa 10 	movl   $0x10aa15,0xc(%esp)
  107aca:	00 
  107acb:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107ad2:	00 
  107ad3:	c7 44 24 04 26 01 00 	movl   $0x126,0x4(%esp)
  107ada:	00 
  107adb:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107ae2:	e8 3a 89 ff ff       	call   100421 <__panic>
    nr_free = nr_free_store;
  107ae7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  107aea:	a3 e8 33 1c 00       	mov    %eax,0x1c33e8

    free_list = free_list_store;
  107aef:	8b 45 80             	mov    -0x80(%ebp),%eax
  107af2:	8b 55 84             	mov    -0x7c(%ebp),%edx
  107af5:	a3 e0 33 1c 00       	mov    %eax,0x1c33e0
  107afa:	89 15 e4 33 1c 00    	mov    %edx,0x1c33e4
    free_pages(p0, 5);
  107b00:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
  107b07:	00 
  107b08:	8b 45 e8             	mov    -0x18(%ebp),%eax
  107b0b:	89 04 24             	mov    %eax,(%esp)
  107b0e:	e8 00 c3 ff ff       	call   103e13 <free_pages>

    le = &free_list;
  107b13:	c7 45 ec e0 33 1c 00 	movl   $0x1c33e0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
  107b1a:	eb 5a                	jmp    107b76 <default_check+0x623>
        assert(le->next->prev == le && le->prev->next == le);
  107b1c:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107b1f:	8b 40 04             	mov    0x4(%eax),%eax
  107b22:	8b 00                	mov    (%eax),%eax
  107b24:	39 45 ec             	cmp    %eax,-0x14(%ebp)
  107b27:	75 0d                	jne    107b36 <default_check+0x5e3>
  107b29:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107b2c:	8b 00                	mov    (%eax),%eax
  107b2e:	8b 40 04             	mov    0x4(%eax),%eax
  107b31:	39 45 ec             	cmp    %eax,-0x14(%ebp)
  107b34:	74 24                	je     107b5a <default_check+0x607>
  107b36:	c7 44 24 0c 84 ab 10 	movl   $0x10ab84,0xc(%esp)
  107b3d:	00 
  107b3e:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107b45:	00 
  107b46:	c7 44 24 04 2e 01 00 	movl   $0x12e,0x4(%esp)
  107b4d:	00 
  107b4e:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107b55:	e8 c7 88 ff ff       	call   100421 <__panic>
        struct Page *p = le2page(le, page_link);
  107b5a:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107b5d:	83 e8 0c             	sub    $0xc,%eax
  107b60:	89 45 d8             	mov    %eax,-0x28(%ebp)
        count --, total -= p->property;
  107b63:	ff 4d f4             	decl   -0xc(%ebp)
  107b66:	8b 55 f0             	mov    -0x10(%ebp),%edx
  107b69:	8b 45 d8             	mov    -0x28(%ebp),%eax
  107b6c:	8b 40 08             	mov    0x8(%eax),%eax
  107b6f:	29 c2                	sub    %eax,%edx
  107b71:	89 d0                	mov    %edx,%eax
  107b73:	89 45 f0             	mov    %eax,-0x10(%ebp)
  107b76:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107b79:	89 45 88             	mov    %eax,-0x78(%ebp)
    return listelm->next;
  107b7c:	8b 45 88             	mov    -0x78(%ebp),%eax
  107b7f:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
  107b82:	89 45 ec             	mov    %eax,-0x14(%ebp)
  107b85:	81 7d ec e0 33 1c 00 	cmpl   $0x1c33e0,-0x14(%ebp)
  107b8c:	75 8e                	jne    107b1c <default_check+0x5c9>
    }
    assert(count == 0);
  107b8e:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  107b92:	74 24                	je     107bb8 <default_check+0x665>
  107b94:	c7 44 24 0c b1 ab 10 	movl   $0x10abb1,0xc(%esp)
  107b9b:	00 
  107b9c:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107ba3:	00 
  107ba4:	c7 44 24 04 32 01 00 	movl   $0x132,0x4(%esp)
  107bab:	00 
  107bac:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107bb3:	e8 69 88 ff ff       	call   100421 <__panic>
    assert(total == 0);
  107bb8:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  107bbc:	74 24                	je     107be2 <default_check+0x68f>
  107bbe:	c7 44 24 0c bc ab 10 	movl   $0x10abbc,0xc(%esp)
  107bc5:	00 
  107bc6:	c7 44 24 08 3a a8 10 	movl   $0x10a83a,0x8(%esp)
  107bcd:	00 
  107bce:	c7 44 24 04 33 01 00 	movl   $0x133,0x4(%esp)
  107bd5:	00 
  107bd6:	c7 04 24 4f a8 10 00 	movl   $0x10a84f,(%esp)
  107bdd:	e8 3f 88 ff ff       	call   100421 <__panic>
}
  107be2:	90                   	nop
  107be3:	c9                   	leave  
  107be4:	c3                   	ret    

00107be5 <page2ppn>:
page2ppn(struct Page *page) {
  107be5:	55                   	push   %ebp
  107be6:	89 e5                	mov    %esp,%ebp
    return page - pages;
  107be8:	a1 08 da 2a 00       	mov    0x2ada08,%eax
  107bed:	8b 55 08             	mov    0x8(%ebp),%edx
  107bf0:	29 c2                	sub    %eax,%edx
  107bf2:	89 d0                	mov    %edx,%eax
  107bf4:	c1 f8 02             	sar    $0x2,%eax
  107bf7:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
  107bfd:	5d                   	pop    %ebp
  107bfe:	c3                   	ret    

00107bff <set_page_ref>:
set_page_ref(struct Page *page, int val) {
  107bff:	55                   	push   %ebp
  107c00:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  107c02:	8b 45 08             	mov    0x8(%ebp),%eax
  107c05:	8b 55 0c             	mov    0xc(%ebp),%edx
  107c08:	89 10                	mov    %edx,(%eax)
}
  107c0a:	90                   	nop
  107c0b:	5d                   	pop    %ebp
  107c0c:	c3                   	ret    

00107c0d <IsPowerOf2>:
#define buddy_array (buddy_s.free_array)
#define max_order (buddy_s.max_order)
#define nr_free (buddy_s.nr_free)

static bool IsPowerOf2(size_t n)
{
  107c0d:	f3 0f 1e fb          	endbr32 
  107c11:	55                   	push   %ebp
  107c12:	89 e5                	mov    %esp,%ebp
    return n&(n-1)==0;
  107c14:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
  107c18:	0f 94 c0             	sete   %al
  107c1b:	0f b6 c0             	movzbl %al,%eax
  107c1e:	23 45 08             	and    0x8(%ebp),%eax
}
  107c21:	5d                   	pop    %ebp
  107c22:	c3                   	ret    

00107c23 <GetOrder>:

static unsigned int GetOrder(size_t n)
{
  107c23:	f3 0f 1e fb          	endbr32 
  107c27:	55                   	push   %ebp
  107c28:	89 e5                	mov    %esp,%ebp
  107c2a:	83 ec 10             	sub    $0x10,%esp
    int order=0;
  107c2d:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while(n>>1)
  107c34:	eb 06                	jmp    107c3c <GetOrder+0x19>
    {
        n>>=1;
  107c36:	d1 6d 08             	shrl   0x8(%ebp)
        order++;
  107c39:	ff 45 fc             	incl   -0x4(%ebp)
    while(n>>1)
  107c3c:	8b 45 08             	mov    0x8(%ebp),%eax
  107c3f:	d1 e8                	shr    %eax
  107c41:	85 c0                	test   %eax,%eax
  107c43:	75 f1                	jne    107c36 <GetOrder+0x13>
    }
    return order;
  107c45:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  107c48:	c9                   	leave  
  107c49:	c3                   	ret    

00107c4a <FixUp>:

static unsigned FixUp(unsigned size) {
  107c4a:	f3 0f 1e fb          	endbr32 
  107c4e:	55                   	push   %ebp
  107c4f:	89 e5                	mov    %esp,%ebp
  107c51:	83 ec 04             	sub    $0x4,%esp
    if(IsPowerOf2(size))
  107c54:	8b 45 08             	mov    0x8(%ebp),%eax
  107c57:	89 04 24             	mov    %eax,(%esp)
  107c5a:	e8 ae ff ff ff       	call   107c0d <IsPowerOf2>
  107c5f:	85 c0                	test   %eax,%eax
  107c61:	74 05                	je     107c68 <FixUp+0x1e>
    {
        return size;
  107c63:	8b 45 08             	mov    0x8(%ebp),%eax
  107c66:	eb 30                	jmp    107c98 <FixUp+0x4e>
    }
    size |= size >> 1;
  107c68:	8b 45 08             	mov    0x8(%ebp),%eax
  107c6b:	d1 e8                	shr    %eax
  107c6d:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 2;
  107c70:	8b 45 08             	mov    0x8(%ebp),%eax
  107c73:	c1 e8 02             	shr    $0x2,%eax
  107c76:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 4;
  107c79:	8b 45 08             	mov    0x8(%ebp),%eax
  107c7c:	c1 e8 04             	shr    $0x4,%eax
  107c7f:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 8;
  107c82:	8b 45 08             	mov    0x8(%ebp),%eax
  107c85:	c1 e8 08             	shr    $0x8,%eax
  107c88:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 16;
  107c8b:	8b 45 08             	mov    0x8(%ebp),%eax
  107c8e:	c1 e8 10             	shr    $0x10,%eax
  107c91:	09 45 08             	or     %eax,0x8(%ebp)
    return size+1;
  107c94:	8b 45 08             	mov    0x8(%ebp),%eax
  107c97:	40                   	inc    %eax
}
  107c98:	c9                   	leave  
  107c99:	c3                   	ret    

00107c9a <FixDown>:

static unsigned FixDown(unsigned size) 
{
  107c9a:	f3 0f 1e fb          	endbr32 
  107c9e:	55                   	push   %ebp
  107c9f:	89 e5                	mov    %esp,%ebp
  107ca1:	83 ec 04             	sub    $0x4,%esp
    if(IsPowerOf2(size))
  107ca4:	8b 45 08             	mov    0x8(%ebp),%eax
  107ca7:	89 04 24             	mov    %eax,(%esp)
  107caa:	e8 5e ff ff ff       	call   107c0d <IsPowerOf2>
  107caf:	85 c0                	test   %eax,%eax
  107cb1:	74 05                	je     107cb8 <FixDown+0x1e>
    {
        return size;
  107cb3:	8b 45 08             	mov    0x8(%ebp),%eax
  107cb6:	eb 0d                	jmp    107cc5 <FixDown+0x2b>
    }
    return (FixUp(size)>>1);
  107cb8:	8b 45 08             	mov    0x8(%ebp),%eax
  107cbb:	89 04 24             	mov    %eax,(%esp)
  107cbe:	e8 87 ff ff ff       	call   107c4a <FixUp>
  107cc3:	d1 e8                	shr    %eax
}
  107cc5:	c9                   	leave  
  107cc6:	c3                   	ret    

00107cc7 <show_buddy_array>:

static void show_buddy_array(void) 
{
  107cc7:	f3 0f 1e fb          	endbr32 
  107ccb:	55                   	push   %ebp
  107ccc:	89 e5                	mov    %esp,%ebp
  107cce:	83 ec 28             	sub    $0x28,%esp
    cprintf("[*]Core: Print buddy array:\n");
  107cd1:	c7 04 24 f8 ab 10 00 	movl   $0x10abf8,(%esp)
  107cd8:	e8 d8 85 ff ff       	call   1002b5 <cprintf>
    for (int i = 0;i < max_order + 1;i ++) 
  107cdd:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  107ce4:	e9 81 00 00 00       	jmp    107d6a <show_buddy_array+0xa3>
    {
        cprintf("%d order: ", i);
  107ce9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107cec:	89 44 24 04          	mov    %eax,0x4(%esp)
  107cf0:	c7 04 24 15 ac 10 00 	movl   $0x10ac15,(%esp)
  107cf7:	e8 b9 85 ff ff       	call   1002b5 <cprintf>
        list_entry_t *le = &(buddy_array[i]);
  107cfc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107cff:	c1 e0 03             	shl    $0x3,%eax
  107d02:	05 20 da 2a 00       	add    $0x2ada20,%eax
  107d07:	83 c0 04             	add    $0x4,%eax
  107d0a:	89 45 f0             	mov    %eax,-0x10(%ebp)
        while ((le = list_next(le)) != &(buddy_array[i])) 
  107d0d:	eb 2a                	jmp    107d39 <show_buddy_array+0x72>
        {
            struct Page *p = le2page(le, page_link);
  107d0f:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107d12:	83 e8 0c             	sub    $0xc,%eax
  107d15:	89 45 ec             	mov    %eax,-0x14(%ebp)
            cprintf("%d ", 1 << (p->property));
  107d18:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107d1b:	8b 40 08             	mov    0x8(%eax),%eax
  107d1e:	ba 01 00 00 00       	mov    $0x1,%edx
  107d23:	88 c1                	mov    %al,%cl
  107d25:	d3 e2                	shl    %cl,%edx
  107d27:	89 d0                	mov    %edx,%eax
  107d29:	89 44 24 04          	mov    %eax,0x4(%esp)
  107d2d:	c7 04 24 20 ac 10 00 	movl   $0x10ac20,(%esp)
  107d34:	e8 7c 85 ff ff       	call   1002b5 <cprintf>
  107d39:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107d3c:	89 45 e8             	mov    %eax,-0x18(%ebp)
  107d3f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  107d42:	8b 40 04             	mov    0x4(%eax),%eax
        while ((le = list_next(le)) != &(buddy_array[i])) 
  107d45:	89 45 f0             	mov    %eax,-0x10(%ebp)
  107d48:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107d4b:	c1 e0 03             	shl    $0x3,%eax
  107d4e:	05 20 da 2a 00       	add    $0x2ada20,%eax
  107d53:	83 c0 04             	add    $0x4,%eax
  107d56:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  107d59:	75 b4                	jne    107d0f <show_buddy_array+0x48>
        }
        cprintf("\n");
  107d5b:	c7 04 24 24 ac 10 00 	movl   $0x10ac24,(%esp)
  107d62:	e8 4e 85 ff ff       	call   1002b5 <cprintf>
    for (int i = 0;i < max_order + 1;i ++) 
  107d67:	ff 45 f4             	incl   -0xc(%ebp)
  107d6a:	a1 20 da 2a 00       	mov    0x2ada20,%eax
  107d6f:	8d 50 01             	lea    0x1(%eax),%edx
  107d72:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107d75:	39 c2                	cmp    %eax,%edx
  107d77:	0f 87 6c ff ff ff    	ja     107ce9 <show_buddy_array+0x22>
    }
    cprintf("---------------------------\n");
  107d7d:	c7 04 24 26 ac 10 00 	movl   $0x10ac26,(%esp)
  107d84:	e8 2c 85 ff ff       	call   1002b5 <cprintf>
    return;
  107d89:	90                   	nop
}
  107d8a:	c9                   	leave  
  107d8b:	c3                   	ret    

00107d8c <buddy_init>:

static void buddy_init()
{
  107d8c:	f3 0f 1e fb          	endbr32 
  107d90:	55                   	push   %ebp
  107d91:	89 e5                	mov    %esp,%ebp
  107d93:	83 ec 10             	sub    $0x10,%esp
    for(int i=0;i<MAX_BUDDY_ORDER;i++)
  107d96:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  107d9d:	eb 29                	jmp    107dc8 <buddy_init+0x3c>
    {
        list_init(&buddy_array[i]);
  107d9f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  107da2:	c1 e0 03             	shl    $0x3,%eax
  107da5:	05 20 da 2a 00       	add    $0x2ada20,%eax
  107daa:	83 c0 04             	add    $0x4,%eax
  107dad:	89 45 f8             	mov    %eax,-0x8(%ebp)
    elm->prev = elm->next = elm;
  107db0:	8b 45 f8             	mov    -0x8(%ebp),%eax
  107db3:	8b 55 f8             	mov    -0x8(%ebp),%edx
  107db6:	89 50 04             	mov    %edx,0x4(%eax)
  107db9:	8b 45 f8             	mov    -0x8(%ebp),%eax
  107dbc:	8b 50 04             	mov    0x4(%eax),%edx
  107dbf:	8b 45 f8             	mov    -0x8(%ebp),%eax
  107dc2:	89 10                	mov    %edx,(%eax)
}
  107dc4:	90                   	nop
    for(int i=0;i<MAX_BUDDY_ORDER;i++)
  107dc5:	ff 45 fc             	incl   -0x4(%ebp)
  107dc8:	83 7d fc 13          	cmpl   $0x13,-0x4(%ebp)
  107dcc:	7e d1                	jle    107d9f <buddy_init+0x13>
    }
    max_order=0;
  107dce:	c7 05 20 da 2a 00 00 	movl   $0x0,0x2ada20
  107dd5:	00 00 00 
    nr_free=0;
  107dd8:	c7 05 cc da 2a 00 00 	movl   $0x0,0x2adacc
  107ddf:	00 00 00 
    return;
  107de2:	90                   	nop
}
  107de3:	c9                   	leave  
  107de4:	c3                   	ret    

00107de5 <buddy_init_memmap>:

static void buddy_init_memmap(struct Page* base,size_t n)
{
  107de5:	f3 0f 1e fb          	endbr32 
  107de9:	55                   	push   %ebp
  107dea:	89 e5                	mov    %esp,%ebp
  107dec:	83 ec 58             	sub    $0x58,%esp
    assert(n>0);
  107def:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  107df3:	75 24                	jne    107e19 <buddy_init_memmap+0x34>
  107df5:	c7 44 24 0c 43 ac 10 	movl   $0x10ac43,0xc(%esp)
  107dfc:	00 
  107dfd:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  107e04:	00 
  107e05:	c7 44 24 04 5b 00 00 	movl   $0x5b,0x4(%esp)
  107e0c:	00 
  107e0d:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  107e14:	e8 08 86 ff ff       	call   100421 <__panic>
    size_t pcnt=FixDown(n);
  107e19:	8b 45 0c             	mov    0xc(%ebp),%eax
  107e1c:	89 04 24             	mov    %eax,(%esp)
  107e1f:	e8 76 fe ff ff       	call   107c9a <FixDown>
  107e24:	89 45 f0             	mov    %eax,-0x10(%ebp)
    size_t order=GetOrder(pcnt);
  107e27:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107e2a:	89 04 24             	mov    %eax,(%esp)
  107e2d:	e8 f1 fd ff ff       	call   107c23 <GetOrder>
  107e32:	89 45 ec             	mov    %eax,-0x14(%ebp)
    struct Page* p=base;
  107e35:	8b 45 08             	mov    0x8(%ebp),%eax
  107e38:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("[*]Core: AVA Page num after rounding down to powers of 2: %d = 2^%d\n", pcnt, order);
  107e3b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107e3e:	89 44 24 08          	mov    %eax,0x8(%esp)
  107e42:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107e45:	89 44 24 04          	mov    %eax,0x4(%esp)
  107e49:	c7 04 24 70 ac 10 00 	movl   $0x10ac70,(%esp)
  107e50:	e8 60 84 ff ff       	call   1002b5 <cprintf>
    for(;p!=base+pcnt;p++)
  107e55:	eb 7b                	jmp    107ed2 <buddy_init_memmap+0xed>
    {
        assert(PageReserved(p));
  107e57:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107e5a:	83 c0 04             	add    $0x4,%eax
  107e5d:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  107e64:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  107e67:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  107e6a:	8b 55 e8             	mov    -0x18(%ebp),%edx
  107e6d:	0f a3 10             	bt     %edx,(%eax)
  107e70:	19 c0                	sbb    %eax,%eax
  107e72:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return oldbit != 0;
  107e75:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  107e79:	0f 95 c0             	setne  %al
  107e7c:	0f b6 c0             	movzbl %al,%eax
  107e7f:	85 c0                	test   %eax,%eax
  107e81:	75 24                	jne    107ea7 <buddy_init_memmap+0xc2>
  107e83:	c7 44 24 0c b5 ac 10 	movl   $0x10acb5,0xc(%esp)
  107e8a:	00 
  107e8b:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  107e92:	00 
  107e93:	c7 44 24 04 62 00 00 	movl   $0x62,0x4(%esp)
  107e9a:	00 
  107e9b:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  107ea2:	e8 7a 85 ff ff       	call   100421 <__panic>
        p->flags=0;
  107ea7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107eaa:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        p->property=-1;
  107eb1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107eb4:	c7 40 08 ff ff ff ff 	movl   $0xffffffff,0x8(%eax)
        set_page_ref(p,0);
  107ebb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  107ec2:	00 
  107ec3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107ec6:	89 04 24             	mov    %eax,(%esp)
  107ec9:	e8 31 fd ff ff       	call   107bff <set_page_ref>
    for(;p!=base+pcnt;p++)
  107ece:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
  107ed2:	8b 55 f0             	mov    -0x10(%ebp),%edx
  107ed5:	89 d0                	mov    %edx,%eax
  107ed7:	c1 e0 03             	shl    $0x3,%eax
  107eda:	01 d0                	add    %edx,%eax
  107edc:	c1 e0 02             	shl    $0x2,%eax
  107edf:	89 c2                	mov    %eax,%edx
  107ee1:	8b 45 08             	mov    0x8(%ebp),%eax
  107ee4:	01 d0                	add    %edx,%eax
  107ee6:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  107ee9:	0f 85 68 ff ff ff    	jne    107e57 <buddy_init_memmap+0x72>
    }
    max_order=order;
  107eef:	8b 45 ec             	mov    -0x14(%ebp),%eax
  107ef2:	a3 20 da 2a 00       	mov    %eax,0x2ada20
    nr_free=pcnt;
  107ef7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  107efa:	a3 cc da 2a 00       	mov    %eax,0x2adacc
    list_add(&(buddy_array[max_order]),&(base->page_link));
  107eff:	8b 45 08             	mov    0x8(%ebp),%eax
  107f02:	83 c0 0c             	add    $0xc,%eax
  107f05:	8b 15 20 da 2a 00    	mov    0x2ada20,%edx
  107f0b:	c1 e2 03             	shl    $0x3,%edx
  107f0e:	81 c2 20 da 2a 00    	add    $0x2ada20,%edx
  107f14:	83 c2 04             	add    $0x4,%edx
  107f17:	89 55 dc             	mov    %edx,-0x24(%ebp)
  107f1a:	89 45 d8             	mov    %eax,-0x28(%ebp)
  107f1d:	8b 45 dc             	mov    -0x24(%ebp),%eax
  107f20:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  107f23:	8b 45 d8             	mov    -0x28(%ebp),%eax
  107f26:	89 45 d0             	mov    %eax,-0x30(%ebp)
    __list_add(elm, listelm, listelm->next);
  107f29:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  107f2c:	8b 40 04             	mov    0x4(%eax),%eax
  107f2f:	8b 55 d0             	mov    -0x30(%ebp),%edx
  107f32:	89 55 cc             	mov    %edx,-0x34(%ebp)
  107f35:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  107f38:	89 55 c8             	mov    %edx,-0x38(%ebp)
  107f3b:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    prev->next = next->prev = elm;
  107f3e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  107f41:	8b 55 cc             	mov    -0x34(%ebp),%edx
  107f44:	89 10                	mov    %edx,(%eax)
  107f46:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  107f49:	8b 10                	mov    (%eax),%edx
  107f4b:	8b 45 c8             	mov    -0x38(%ebp),%eax
  107f4e:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  107f51:	8b 45 cc             	mov    -0x34(%ebp),%eax
  107f54:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  107f57:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  107f5a:	8b 45 cc             	mov    -0x34(%ebp),%eax
  107f5d:	8b 55 c8             	mov    -0x38(%ebp),%edx
  107f60:	89 10                	mov    %edx,(%eax)
}
  107f62:	90                   	nop
}
  107f63:	90                   	nop
}
  107f64:	90                   	nop
    base->property=max_order;
  107f65:	8b 15 20 da 2a 00    	mov    0x2ada20,%edx
  107f6b:	8b 45 08             	mov    0x8(%ebp),%eax
  107f6e:	89 50 08             	mov    %edx,0x8(%eax)
    return;
  107f71:	90                   	nop
}
  107f72:	c9                   	leave  
  107f73:	c3                   	ret    

00107f74 <buddy_find>:

static struct Page* buddy_find(struct Page *page) 
{
  107f74:	f3 0f 1e fb          	endbr32 
  107f78:	55                   	push   %ebp
  107f79:	89 e5                	mov    %esp,%ebp
  107f7b:	53                   	push   %ebx
  107f7c:	83 ec 24             	sub    $0x24,%esp
    unsigned int order = page->property;
  107f7f:	8b 45 08             	mov    0x8(%ebp),%eax
  107f82:	8b 40 08             	mov    0x8(%eax),%eax
  107f85:	89 45 f4             	mov    %eax,-0xc(%ebp)
    unsigned int buddy_ppn = first_ppn + ((1 << order) ^ (page2ppn(page) - first_ppn));
  107f88:	8b 45 f4             	mov    -0xc(%ebp),%eax
  107f8b:	ba 01 00 00 00       	mov    $0x1,%edx
  107f90:	88 c1                	mov    %al,%cl
  107f92:	d3 e2                	shl    %cl,%edx
  107f94:	89 d0                	mov    %edx,%eax
  107f96:	89 c3                	mov    %eax,%ebx
  107f98:	8b 45 08             	mov    0x8(%ebp),%eax
  107f9b:	89 04 24             	mov    %eax,(%esp)
  107f9e:	e8 42 fc ff ff       	call   107be5 <page2ppn>
  107fa3:	8b 15 84 6e 12 00    	mov    0x126e84,%edx
  107fa9:	29 d0                	sub    %edx,%eax
  107fab:	31 c3                	xor    %eax,%ebx
  107fad:	89 da                	mov    %ebx,%edx
  107faf:	a1 84 6e 12 00       	mov    0x126e84,%eax
  107fb4:	01 d0                	add    %edx,%eax
  107fb6:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cprintf("[*]Core: Page NO.%d 's buddy page on order %d is: %d\n", page2ppn(page), order, buddy_ppn);
  107fb9:	8b 45 08             	mov    0x8(%ebp),%eax
  107fbc:	89 04 24             	mov    %eax,(%esp)
  107fbf:	e8 21 fc ff ff       	call   107be5 <page2ppn>
  107fc4:	8b 55 f0             	mov    -0x10(%ebp),%edx
  107fc7:	89 54 24 0c          	mov    %edx,0xc(%esp)
  107fcb:	8b 55 f4             	mov    -0xc(%ebp),%edx
  107fce:	89 54 24 08          	mov    %edx,0x8(%esp)
  107fd2:	89 44 24 04          	mov    %eax,0x4(%esp)
  107fd6:	c7 04 24 c8 ac 10 00 	movl   $0x10acc8,(%esp)
  107fdd:	e8 d3 82 ff ff       	call   1002b5 <cprintf>
    if (buddy_ppn > page2ppn(page))
  107fe2:	8b 45 08             	mov    0x8(%ebp),%eax
  107fe5:	89 04 24             	mov    %eax,(%esp)
  107fe8:	e8 f8 fb ff ff       	call   107be5 <page2ppn>
  107fed:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  107ff0:	76 23                	jbe    108015 <buddy_find+0xa1>
    {
        return page + (buddy_ppn - page2ppn(page));
  107ff2:	8b 45 08             	mov    0x8(%ebp),%eax
  107ff5:	89 04 24             	mov    %eax,(%esp)
  107ff8:	e8 e8 fb ff ff       	call   107be5 <page2ppn>
  107ffd:	8b 55 f0             	mov    -0x10(%ebp),%edx
  108000:	29 c2                	sub    %eax,%edx
  108002:	89 d0                	mov    %edx,%eax
  108004:	c1 e0 03             	shl    $0x3,%eax
  108007:	01 d0                	add    %edx,%eax
  108009:	c1 e0 02             	shl    $0x2,%eax
  10800c:	89 c2                	mov    %eax,%edx
  10800e:	8b 45 08             	mov    0x8(%ebp),%eax
  108011:	01 d0                	add    %edx,%eax
  108013:	eb 23                	jmp    108038 <buddy_find+0xc4>
    }
    else 
    {
        return page - (page2ppn(page) - buddy_ppn);
  108015:	8b 45 08             	mov    0x8(%ebp),%eax
  108018:	89 04 24             	mov    %eax,(%esp)
  10801b:	e8 c5 fb ff ff       	call   107be5 <page2ppn>
  108020:	2b 45 f0             	sub    -0x10(%ebp),%eax
  108023:	89 c2                	mov    %eax,%edx
  108025:	89 d0                	mov    %edx,%eax
  108027:	c1 e0 03             	shl    $0x3,%eax
  10802a:	01 d0                	add    %edx,%eax
  10802c:	c1 e0 02             	shl    $0x2,%eax
  10802f:	f7 d8                	neg    %eax
  108031:	89 c2                	mov    %eax,%edx
  108033:	8b 45 08             	mov    0x8(%ebp),%eax
  108036:	01 d0                	add    %edx,%eax
    }
}
  108038:	83 c4 24             	add    $0x24,%esp
  10803b:	5b                   	pop    %ebx
  10803c:	5d                   	pop    %ebp
  10803d:	c3                   	ret    

0010803e <buddy_split>:

static void buddy_split(size_t n) 
{
  10803e:	f3 0f 1e fb          	endbr32 
  108042:	55                   	push   %ebp
  108043:	89 e5                	mov    %esp,%ebp
  108045:	83 ec 78             	sub    $0x78,%esp
    assert(n > 0 && n <= max_order);
  108048:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  10804c:	74 0a                	je     108058 <buddy_split+0x1a>
  10804e:	a1 20 da 2a 00       	mov    0x2ada20,%eax
  108053:	39 45 08             	cmp    %eax,0x8(%ebp)
  108056:	76 24                	jbe    10807c <buddy_split+0x3e>
  108058:	c7 44 24 0c fe ac 10 	movl   $0x10acfe,0xc(%esp)
  10805f:	00 
  108060:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108067:	00 
  108068:	c7 44 24 04 7f 00 00 	movl   $0x7f,0x4(%esp)
  10806f:	00 
  108070:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108077:	e8 a5 83 ff ff       	call   100421 <__panic>
    assert(!list_empty(&(buddy_array[n])));
  10807c:	8b 45 08             	mov    0x8(%ebp),%eax
  10807f:	c1 e0 03             	shl    $0x3,%eax
  108082:	05 20 da 2a 00       	add    $0x2ada20,%eax
  108087:	83 c0 04             	add    $0x4,%eax
  10808a:	89 45 ec             	mov    %eax,-0x14(%ebp)
    return list->next == list;
  10808d:	8b 45 ec             	mov    -0x14(%ebp),%eax
  108090:	8b 40 04             	mov    0x4(%eax),%eax
  108093:	39 45 ec             	cmp    %eax,-0x14(%ebp)
  108096:	0f 94 c0             	sete   %al
  108099:	0f b6 c0             	movzbl %al,%eax
  10809c:	85 c0                	test   %eax,%eax
  10809e:	74 24                	je     1080c4 <buddy_split+0x86>
  1080a0:	c7 44 24 0c 18 ad 10 	movl   $0x10ad18,0xc(%esp)
  1080a7:	00 
  1080a8:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  1080af:	00 
  1080b0:	c7 44 24 04 80 00 00 	movl   $0x80,0x4(%esp)
  1080b7:	00 
  1080b8:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  1080bf:	e8 5d 83 ff ff       	call   100421 <__panic>
    cprintf("[*]Core: SPLITTING!\n");
  1080c4:	c7 04 24 37 ad 10 00 	movl   $0x10ad37,(%esp)
  1080cb:	e8 e5 81 ff ff       	call   1002b5 <cprintf>
    struct Page *page_a;
    struct Page *page_b;

    page_a = le2page(list_next(&(buddy_array[n])), page_link);
  1080d0:	8b 45 08             	mov    0x8(%ebp),%eax
  1080d3:	c1 e0 03             	shl    $0x3,%eax
  1080d6:	05 20 da 2a 00       	add    $0x2ada20,%eax
  1080db:	83 c0 04             	add    $0x4,%eax
  1080de:	89 45 a0             	mov    %eax,-0x60(%ebp)
    return listelm->next;
  1080e1:	8b 45 a0             	mov    -0x60(%ebp),%eax
  1080e4:	8b 40 04             	mov    0x4(%eax),%eax
  1080e7:	83 e8 0c             	sub    $0xc,%eax
  1080ea:	89 45 f4             	mov    %eax,-0xc(%ebp)
    page_b = page_a + (1 << (n - 1));
  1080ed:	8b 45 08             	mov    0x8(%ebp),%eax
  1080f0:	48                   	dec    %eax
  1080f1:	ba 24 00 00 00       	mov    $0x24,%edx
  1080f6:	88 c1                	mov    %al,%cl
  1080f8:	d3 e2                	shl    %cl,%edx
  1080fa:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1080fd:	01 d0                	add    %edx,%eax
  1080ff:	89 45 f0             	mov    %eax,-0x10(%ebp)
    page_a->property = n - 1;
  108102:	8b 45 08             	mov    0x8(%ebp),%eax
  108105:	8d 50 ff             	lea    -0x1(%eax),%edx
  108108:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10810b:	89 50 08             	mov    %edx,0x8(%eax)
    page_b->property = n - 1;
  10810e:	8b 45 08             	mov    0x8(%ebp),%eax
  108111:	8d 50 ff             	lea    -0x1(%eax),%edx
  108114:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108117:	89 50 08             	mov    %edx,0x8(%eax)

    list_del(list_next(&(buddy_array[n])));
  10811a:	8b 45 08             	mov    0x8(%ebp),%eax
  10811d:	c1 e0 03             	shl    $0x3,%eax
  108120:	05 20 da 2a 00       	add    $0x2ada20,%eax
  108125:	83 c0 04             	add    $0x4,%eax
  108128:	89 45 a4             	mov    %eax,-0x5c(%ebp)
  10812b:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  10812e:	8b 40 04             	mov    0x4(%eax),%eax
  108131:	89 45 b0             	mov    %eax,-0x50(%ebp)
    __list_del(listelm->prev, listelm->next);
  108134:	8b 45 b0             	mov    -0x50(%ebp),%eax
  108137:	8b 40 04             	mov    0x4(%eax),%eax
  10813a:	8b 55 b0             	mov    -0x50(%ebp),%edx
  10813d:	8b 12                	mov    (%edx),%edx
  10813f:	89 55 ac             	mov    %edx,-0x54(%ebp)
  108142:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next;
  108145:	8b 45 ac             	mov    -0x54(%ebp),%eax
  108148:	8b 55 a8             	mov    -0x58(%ebp),%edx
  10814b:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  10814e:	8b 45 a8             	mov    -0x58(%ebp),%eax
  108151:	8b 55 ac             	mov    -0x54(%ebp),%edx
  108154:	89 10                	mov    %edx,(%eax)
}
  108156:	90                   	nop
}
  108157:	90                   	nop
    list_add(&(buddy_array[n-1]), &(page_a->page_link));
  108158:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10815b:	83 c0 0c             	add    $0xc,%eax
  10815e:	8b 55 08             	mov    0x8(%ebp),%edx
  108161:	4a                   	dec    %edx
  108162:	c1 e2 03             	shl    $0x3,%edx
  108165:	81 c2 20 da 2a 00    	add    $0x2ada20,%edx
  10816b:	83 c2 04             	add    $0x4,%edx
  10816e:	89 55 cc             	mov    %edx,-0x34(%ebp)
  108171:	89 45 c8             	mov    %eax,-0x38(%ebp)
  108174:	8b 45 cc             	mov    -0x34(%ebp),%eax
  108177:	89 45 c4             	mov    %eax,-0x3c(%ebp)
  10817a:	8b 45 c8             	mov    -0x38(%ebp),%eax
  10817d:	89 45 c0             	mov    %eax,-0x40(%ebp)
    __list_add(elm, listelm, listelm->next);
  108180:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  108183:	8b 40 04             	mov    0x4(%eax),%eax
  108186:	8b 55 c0             	mov    -0x40(%ebp),%edx
  108189:	89 55 bc             	mov    %edx,-0x44(%ebp)
  10818c:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  10818f:	89 55 b8             	mov    %edx,-0x48(%ebp)
  108192:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    prev->next = next->prev = elm;
  108195:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  108198:	8b 55 bc             	mov    -0x44(%ebp),%edx
  10819b:	89 10                	mov    %edx,(%eax)
  10819d:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  1081a0:	8b 10                	mov    (%eax),%edx
  1081a2:	8b 45 b8             	mov    -0x48(%ebp),%eax
  1081a5:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  1081a8:	8b 45 bc             	mov    -0x44(%ebp),%eax
  1081ab:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  1081ae:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  1081b1:	8b 45 bc             	mov    -0x44(%ebp),%eax
  1081b4:	8b 55 b8             	mov    -0x48(%ebp),%edx
  1081b7:	89 10                	mov    %edx,(%eax)
}
  1081b9:	90                   	nop
}
  1081ba:	90                   	nop
}
  1081bb:	90                   	nop
    list_add(&(page_a->page_link), &(page_b->page_link));
  1081bc:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1081bf:	83 c0 0c             	add    $0xc,%eax
  1081c2:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1081c5:	83 c2 0c             	add    $0xc,%edx
  1081c8:	89 55 e8             	mov    %edx,-0x18(%ebp)
  1081cb:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1081ce:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1081d1:	89 45 e0             	mov    %eax,-0x20(%ebp)
  1081d4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1081d7:	89 45 dc             	mov    %eax,-0x24(%ebp)
    __list_add(elm, listelm, listelm->next);
  1081da:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1081dd:	8b 40 04             	mov    0x4(%eax),%eax
  1081e0:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1081e3:	89 55 d8             	mov    %edx,-0x28(%ebp)
  1081e6:	8b 55 e0             	mov    -0x20(%ebp),%edx
  1081e9:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  1081ec:	89 45 d0             	mov    %eax,-0x30(%ebp)
    prev->next = next->prev = elm;
  1081ef:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1081f2:	8b 55 d8             	mov    -0x28(%ebp),%edx
  1081f5:	89 10                	mov    %edx,(%eax)
  1081f7:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1081fa:	8b 10                	mov    (%eax),%edx
  1081fc:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1081ff:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  108202:	8b 45 d8             	mov    -0x28(%ebp),%eax
  108205:	8b 55 d0             	mov    -0x30(%ebp),%edx
  108208:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  10820b:	8b 45 d8             	mov    -0x28(%ebp),%eax
  10820e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  108211:	89 10                	mov    %edx,(%eax)
}
  108213:	90                   	nop
}
  108214:	90                   	nop
}
  108215:	90                   	nop

    return;
  108216:	90                   	nop
}
  108217:	c9                   	leave  
  108218:	c3                   	ret    

00108219 <buddy_alloc_pages>:

static struct Page *buddy_alloc_pages(size_t n) 
{
  108219:	f3 0f 1e fb          	endbr32 
  10821d:	55                   	push   %ebp
  10821e:	89 e5                	mov    %esp,%ebp
  108220:	83 ec 58             	sub    $0x58,%esp
    assert(n > 0);
  108223:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  108227:	75 24                	jne    10824d <buddy_alloc_pages+0x34>
  108229:	c7 44 24 0c 4c ad 10 	movl   $0x10ad4c,0xc(%esp)
  108230:	00 
  108231:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108238:	00 
  108239:	c7 44 24 04 93 00 00 	movl   $0x93,0x4(%esp)
  108240:	00 
  108241:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108248:	e8 d4 81 ff ff       	call   100421 <__panic>
    if (n > nr_free) 
  10824d:	a1 cc da 2a 00       	mov    0x2adacc,%eax
  108252:	39 45 08             	cmp    %eax,0x8(%ebp)
  108255:	76 0a                	jbe    108261 <buddy_alloc_pages+0x48>
    {
        return NULL;
  108257:	b8 00 00 00 00       	mov    $0x0,%eax
  10825c:	e9 82 01 00 00       	jmp    1083e3 <buddy_alloc_pages+0x1ca>
    }
    struct Page *page = NULL;
  108261:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    size_t pnum = FixUp(n);
  108268:	8b 45 08             	mov    0x8(%ebp),%eax
  10826b:	89 04 24             	mov    %eax,(%esp)
  10826e:	e8 d7 f9 ff ff       	call   107c4a <FixUp>
  108273:	89 45 ec             	mov    %eax,-0x14(%ebp)
    size_t order = 0;
  108276:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
    order = GetOrder(pnum);
  10827d:	8b 45 ec             	mov    -0x14(%ebp),%eax
  108280:	89 04 24             	mov    %eax,(%esp)
  108283:	e8 9b f9 ff ff       	call   107c23 <GetOrder>
  108288:	89 45 e8             	mov    %eax,-0x18(%ebp)
    cprintf("[*]Core: Allocating %d-->%d = 2^%d pages ...\n", n, pnum, order);
  10828b:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10828e:	89 44 24 0c          	mov    %eax,0xc(%esp)
  108292:	8b 45 ec             	mov    -0x14(%ebp),%eax
  108295:	89 44 24 08          	mov    %eax,0x8(%esp)
  108299:	8b 45 08             	mov    0x8(%ebp),%eax
  10829c:	89 44 24 04          	mov    %eax,0x4(%esp)
  1082a0:	c7 04 24 54 ad 10 00 	movl   $0x10ad54,(%esp)
  1082a7:	e8 09 80 ff ff       	call   1002b5 <cprintf>
    cprintf("[*]COre: Buddy array before ALLOC:\n");
  1082ac:	c7 04 24 84 ad 10 00 	movl   $0x10ad84,(%esp)
  1082b3:	e8 fd 7f ff ff       	call   1002b5 <cprintf>
    //show_buddy_array();
    while(list_empty(&buddy_array[order]))
  1082b8:	eb 4b                	jmp    108305 <buddy_alloc_pages+0xec>
    {
        for(int i=order;i<max_order+1;i++)
  1082ba:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1082bd:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1082c0:	eb 34                	jmp    1082f6 <buddy_alloc_pages+0xdd>
        {
            if(!list_empty(&buddy_array[i]))
  1082c2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1082c5:	c1 e0 03             	shl    $0x3,%eax
  1082c8:	05 20 da 2a 00       	add    $0x2ada20,%eax
  1082cd:	83 c0 04             	add    $0x4,%eax
  1082d0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return list->next == list;
  1082d3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1082d6:	8b 40 04             	mov    0x4(%eax),%eax
  1082d9:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  1082dc:	0f 94 c0             	sete   %al
  1082df:	0f b6 c0             	movzbl %al,%eax
  1082e2:	85 c0                	test   %eax,%eax
  1082e4:	75 0d                	jne    1082f3 <buddy_alloc_pages+0xda>
            {
                buddy_split(i);
  1082e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1082e9:	89 04 24             	mov    %eax,(%esp)
  1082ec:	e8 4d fd ff ff       	call   10803e <buddy_split>
                break;
  1082f1:	eb 12                	jmp    108305 <buddy_alloc_pages+0xec>
        for(int i=order;i<max_order+1;i++)
  1082f3:	ff 45 f4             	incl   -0xc(%ebp)
  1082f6:	a1 20 da 2a 00       	mov    0x2ada20,%eax
  1082fb:	8d 50 01             	lea    0x1(%eax),%edx
  1082fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108301:	39 c2                	cmp    %eax,%edx
  108303:	77 bd                	ja     1082c2 <buddy_alloc_pages+0xa9>
    while(list_empty(&buddy_array[order]))
  108305:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108308:	c1 e0 03             	shl    $0x3,%eax
  10830b:	05 20 da 2a 00       	add    $0x2ada20,%eax
  108310:	83 c0 04             	add    $0x4,%eax
  108313:	89 45 e0             	mov    %eax,-0x20(%ebp)
  108316:	8b 45 e0             	mov    -0x20(%ebp),%eax
  108319:	8b 40 04             	mov    0x4(%eax),%eax
  10831c:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  10831f:	0f 94 c0             	sete   %al
  108322:	0f b6 c0             	movzbl %al,%eax
  108325:	85 c0                	test   %eax,%eax
  108327:	75 91                	jne    1082ba <buddy_alloc_pages+0xa1>
            }
        }
    }
    page = le2page(list_next(&(buddy_array[order])), page_link);
  108329:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10832c:	c1 e0 03             	shl    $0x3,%eax
  10832f:	05 20 da 2a 00       	add    $0x2ada20,%eax
  108334:	83 c0 04             	add    $0x4,%eax
  108337:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
  10833a:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  10833d:	8b 40 04             	mov    0x4(%eax),%eax
  108340:	83 e8 0c             	sub    $0xc,%eax
  108343:	89 45 f0             	mov    %eax,-0x10(%ebp)
    list_del(list_next(&(buddy_array[order])));
  108346:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108349:	c1 e0 03             	shl    $0x3,%eax
  10834c:	05 20 da 2a 00       	add    $0x2ada20,%eax
  108351:	83 c0 04             	add    $0x4,%eax
  108354:	89 45 c8             	mov    %eax,-0x38(%ebp)
  108357:	8b 45 c8             	mov    -0x38(%ebp),%eax
  10835a:	8b 40 04             	mov    0x4(%eax),%eax
  10835d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    __list_del(listelm->prev, listelm->next);
  108360:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  108363:	8b 40 04             	mov    0x4(%eax),%eax
  108366:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  108369:	8b 12                	mov    (%edx),%edx
  10836b:	89 55 d0             	mov    %edx,-0x30(%ebp)
  10836e:	89 45 cc             	mov    %eax,-0x34(%ebp)
    prev->next = next;
  108371:	8b 45 d0             	mov    -0x30(%ebp),%eax
  108374:	8b 55 cc             	mov    -0x34(%ebp),%edx
  108377:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  10837a:	8b 45 cc             	mov    -0x34(%ebp),%eax
  10837d:	8b 55 d0             	mov    -0x30(%ebp),%edx
  108380:	89 10                	mov    %edx,(%eax)
}
  108382:	90                   	nop
}
  108383:	90                   	nop
    SetPageProperty(page);
  108384:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108387:	83 c0 04             	add    $0x4,%eax
  10838a:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
  108391:	89 45 d8             	mov    %eax,-0x28(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  108394:	8b 45 d8             	mov    -0x28(%ebp),%eax
  108397:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10839a:	0f ab 10             	bts    %edx,(%eax)
}
  10839d:	90                   	nop
    cprintf("[*]Core: Buddy array after ALLOC NO.%d page:\n", page2ppn(page));
  10839e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1083a1:	89 04 24             	mov    %eax,(%esp)
  1083a4:	e8 3c f8 ff ff       	call   107be5 <page2ppn>
  1083a9:	89 44 24 04          	mov    %eax,0x4(%esp)
  1083ad:	c7 04 24 a8 ad 10 00 	movl   $0x10ada8,(%esp)
  1083b4:	e8 fc 7e ff ff       	call   1002b5 <cprintf>
    show_buddy_array();
  1083b9:	e8 09 f9 ff ff       	call   107cc7 <show_buddy_array>
    nr_free -= pnum;
  1083be:	a1 cc da 2a 00       	mov    0x2adacc,%eax
  1083c3:	2b 45 ec             	sub    -0x14(%ebp),%eax
  1083c6:	a3 cc da 2a 00       	mov    %eax,0x2adacc
    cprintf("[*]Core: nr_free: %d\n", nr_free);
  1083cb:	a1 cc da 2a 00       	mov    0x2adacc,%eax
  1083d0:	89 44 24 04          	mov    %eax,0x4(%esp)
  1083d4:	c7 04 24 d6 ad 10 00 	movl   $0x10add6,(%esp)
  1083db:	e8 d5 7e ff ff       	call   1002b5 <cprintf>
    return page;
  1083e0:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  1083e3:	c9                   	leave  
  1083e4:	c3                   	ret    

001083e5 <buddy_free_pages>:

static void buddy_free_pages(struct Page *base, size_t n) 
{
  1083e5:	f3 0f 1e fb          	endbr32 
  1083e9:	55                   	push   %ebp
  1083ea:	89 e5                	mov    %esp,%ebp
  1083ec:	81 ec 98 00 00 00    	sub    $0x98,%esp
    assert(n > 0);
  1083f2:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  1083f6:	75 24                	jne    10841c <buddy_free_pages+0x37>
  1083f8:	c7 44 24 0c 4c ad 10 	movl   $0x10ad4c,0xc(%esp)
  1083ff:	00 
  108400:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108407:	00 
  108408:	c7 44 24 04 b6 00 00 	movl   $0xb6,0x4(%esp)
  10840f:	00 
  108410:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108417:	e8 05 80 ff ff       	call   100421 <__panic>
    unsigned int pnum = 1 << (base->property);
  10841c:	8b 45 08             	mov    0x8(%ebp),%eax
  10841f:	8b 40 08             	mov    0x8(%eax),%eax
  108422:	ba 01 00 00 00       	mov    $0x1,%edx
  108427:	88 c1                	mov    %al,%cl
  108429:	d3 e2                	shl    %cl,%edx
  10842b:	89 d0                	mov    %edx,%eax
  10842d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(FixUp(n) == pnum);
  108430:	8b 45 0c             	mov    0xc(%ebp),%eax
  108433:	89 04 24             	mov    %eax,(%esp)
  108436:	e8 0f f8 ff ff       	call   107c4a <FixUp>
  10843b:	39 45 ec             	cmp    %eax,-0x14(%ebp)
  10843e:	74 24                	je     108464 <buddy_free_pages+0x7f>
  108440:	c7 44 24 0c ec ad 10 	movl   $0x10adec,0xc(%esp)
  108447:	00 
  108448:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  10844f:	00 
  108450:	c7 44 24 04 b8 00 00 	movl   $0xb8,0x4(%esp)
  108457:	00 
  108458:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  10845f:	e8 bd 7f ff ff       	call   100421 <__panic>
    cprintf("[*]Core: Freeing NO.%d page leading %d pages block: \n", page2ppn(base), pnum);
  108464:	8b 45 08             	mov    0x8(%ebp),%eax
  108467:	89 04 24             	mov    %eax,(%esp)
  10846a:	e8 76 f7 ff ff       	call   107be5 <page2ppn>
  10846f:	8b 55 ec             	mov    -0x14(%ebp),%edx
  108472:	89 54 24 08          	mov    %edx,0x8(%esp)
  108476:	89 44 24 04          	mov    %eax,0x4(%esp)
  10847a:	c7 04 24 00 ae 10 00 	movl   $0x10ae00,(%esp)
  108481:	e8 2f 7e ff ff       	call   1002b5 <cprintf>
    struct Page* left_block = base;
  108486:	8b 45 08             	mov    0x8(%ebp),%eax
  108489:	89 45 f4             	mov    %eax,-0xc(%ebp)
    struct Page* buddy = NULL;
  10848c:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    struct Page* tmp = NULL;
  108493:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)

    buddy = buddy_find(left_block);
  10849a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10849d:	89 04 24             	mov    %eax,(%esp)
  1084a0:	e8 cf fa ff ff       	call   107f74 <buddy_find>
  1084a5:	89 45 f0             	mov    %eax,-0x10(%ebp)
    list_add(&(buddy_array[left_block->property]), &(left_block->page_link));
  1084a8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1084ab:	8d 50 0c             	lea    0xc(%eax),%edx
  1084ae:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1084b1:	8b 40 08             	mov    0x8(%eax),%eax
  1084b4:	c1 e0 03             	shl    $0x3,%eax
  1084b7:	05 20 da 2a 00       	add    $0x2ada20,%eax
  1084bc:	83 c0 04             	add    $0x4,%eax
  1084bf:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1084c2:	89 55 e0             	mov    %edx,-0x20(%ebp)
  1084c5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1084c8:	89 45 dc             	mov    %eax,-0x24(%ebp)
  1084cb:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1084ce:	89 45 d8             	mov    %eax,-0x28(%ebp)
    __list_add(elm, listelm, listelm->next);
  1084d1:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1084d4:	8b 40 04             	mov    0x4(%eax),%eax
  1084d7:	8b 55 d8             	mov    -0x28(%ebp),%edx
  1084da:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  1084dd:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1084e0:	89 55 d0             	mov    %edx,-0x30(%ebp)
  1084e3:	89 45 cc             	mov    %eax,-0x34(%ebp)
    prev->next = next->prev = elm;
  1084e6:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1084e9:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1084ec:	89 10                	mov    %edx,(%eax)
  1084ee:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1084f1:	8b 10                	mov    (%eax),%edx
  1084f3:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1084f6:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  1084f9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1084fc:	8b 55 cc             	mov    -0x34(%ebp),%edx
  1084ff:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  108502:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  108505:	8b 55 d0             	mov    -0x30(%ebp),%edx
  108508:	89 10                	mov    %edx,(%eax)
}
  10850a:	90                   	nop
}
  10850b:	90                   	nop
}
  10850c:	90                   	nop
    cprintf("[*]Core: add to list\n");
  10850d:	c7 04 24 36 ae 10 00 	movl   $0x10ae36,(%esp)
  108514:	e8 9c 7d ff ff       	call   1002b5 <cprintf>
    //show_buddy_array();
    while (!PageProperty(buddy) && left_block->property < max_order) 
  108519:	e9 2b 01 00 00       	jmp    108649 <buddy_free_pages+0x264>
    {
        cprintf("[*]Core: Buddy free, MERGING!\n");
  10851e:	c7 04 24 4c ae 10 00 	movl   $0x10ae4c,(%esp)
  108525:	e8 8b 7d ff ff       	call   1002b5 <cprintf>
        if (left_block > buddy)//buddy is on the left
  10852a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10852d:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  108530:	76 36                	jbe    108568 <buddy_free_pages+0x183>
         {
            left_block->property = -1;
  108532:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108535:	c7 40 08 ff ff ff ff 	movl   $0xffffffff,0x8(%eax)
            ClearPageProperty(left_block);
  10853c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10853f:	83 c0 04             	add    $0x4,%eax
  108542:	c7 45 c8 01 00 00 00 	movl   $0x1,-0x38(%ebp)
  108549:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  10854c:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  10854f:	8b 55 c8             	mov    -0x38(%ebp),%edx
  108552:	0f b3 10             	btr    %edx,(%eax)
}
  108555:	90                   	nop
            //redefine the "left"
            tmp = left_block;
  108556:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108559:	89 45 e8             	mov    %eax,-0x18(%ebp)
            left_block = buddy;
  10855c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10855f:	89 45 f4             	mov    %eax,-0xc(%ebp)
            buddy = tmp;
  108562:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108565:	89 45 f0             	mov    %eax,-0x10(%ebp)
        }
        list_del(&(left_block->page_link));    
  108568:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10856b:	83 c0 0c             	add    $0xc,%eax
  10856e:	89 45 98             	mov    %eax,-0x68(%ebp)
    __list_del(listelm->prev, listelm->next);
  108571:	8b 45 98             	mov    -0x68(%ebp),%eax
  108574:	8b 40 04             	mov    0x4(%eax),%eax
  108577:	8b 55 98             	mov    -0x68(%ebp),%edx
  10857a:	8b 12                	mov    (%edx),%edx
  10857c:	89 55 94             	mov    %edx,-0x6c(%ebp)
  10857f:	89 45 90             	mov    %eax,-0x70(%ebp)
    prev->next = next;
  108582:	8b 45 94             	mov    -0x6c(%ebp),%eax
  108585:	8b 55 90             	mov    -0x70(%ebp),%edx
  108588:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  10858b:	8b 45 90             	mov    -0x70(%ebp),%eax
  10858e:	8b 55 94             	mov    -0x6c(%ebp),%edx
  108591:	89 10                	mov    %edx,(%eax)
}
  108593:	90                   	nop
}
  108594:	90                   	nop
        list_del(&(buddy->page_link));
  108595:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108598:	83 c0 0c             	add    $0xc,%eax
  10859b:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    __list_del(listelm->prev, listelm->next);
  10859e:	8b 45 a4             	mov    -0x5c(%ebp),%eax
  1085a1:	8b 40 04             	mov    0x4(%eax),%eax
  1085a4:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  1085a7:	8b 12                	mov    (%edx),%edx
  1085a9:	89 55 a0             	mov    %edx,-0x60(%ebp)
  1085ac:	89 45 9c             	mov    %eax,-0x64(%ebp)
    prev->next = next;
  1085af:	8b 45 a0             	mov    -0x60(%ebp),%eax
  1085b2:	8b 55 9c             	mov    -0x64(%ebp),%edx
  1085b5:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  1085b8:	8b 45 9c             	mov    -0x64(%ebp),%eax
  1085bb:	8b 55 a0             	mov    -0x60(%ebp),%edx
  1085be:	89 10                	mov    %edx,(%eax)
}
  1085c0:	90                   	nop
}
  1085c1:	90                   	nop
        left_block->property += 1;
  1085c2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1085c5:	8b 40 08             	mov    0x8(%eax),%eax
  1085c8:	8d 50 01             	lea    0x1(%eax),%edx
  1085cb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1085ce:	89 50 08             	mov    %edx,0x8(%eax)
        list_add(&(buddy_array[left_block->property]), &(left_block->page_link));
  1085d1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1085d4:	8d 50 0c             	lea    0xc(%eax),%edx
  1085d7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1085da:	8b 40 08             	mov    0x8(%eax),%eax
  1085dd:	c1 e0 03             	shl    $0x3,%eax
  1085e0:	05 20 da 2a 00       	add    $0x2ada20,%eax
  1085e5:	83 c0 04             	add    $0x4,%eax
  1085e8:	89 45 c0             	mov    %eax,-0x40(%ebp)
  1085eb:	89 55 bc             	mov    %edx,-0x44(%ebp)
  1085ee:	8b 45 c0             	mov    -0x40(%ebp),%eax
  1085f1:	89 45 b8             	mov    %eax,-0x48(%ebp)
  1085f4:	8b 45 bc             	mov    -0x44(%ebp),%eax
  1085f7:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    __list_add(elm, listelm, listelm->next);
  1085fa:	8b 45 b8             	mov    -0x48(%ebp),%eax
  1085fd:	8b 40 04             	mov    0x4(%eax),%eax
  108600:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  108603:	89 55 b0             	mov    %edx,-0x50(%ebp)
  108606:	8b 55 b8             	mov    -0x48(%ebp),%edx
  108609:	89 55 ac             	mov    %edx,-0x54(%ebp)
  10860c:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next->prev = elm;
  10860f:	8b 45 a8             	mov    -0x58(%ebp),%eax
  108612:	8b 55 b0             	mov    -0x50(%ebp),%edx
  108615:	89 10                	mov    %edx,(%eax)
  108617:	8b 45 a8             	mov    -0x58(%ebp),%eax
  10861a:	8b 10                	mov    (%eax),%edx
  10861c:	8b 45 ac             	mov    -0x54(%ebp),%eax
  10861f:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  108622:	8b 45 b0             	mov    -0x50(%ebp),%eax
  108625:	8b 55 a8             	mov    -0x58(%ebp),%edx
  108628:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  10862b:	8b 45 b0             	mov    -0x50(%ebp),%eax
  10862e:	8b 55 ac             	mov    -0x54(%ebp),%edx
  108631:	89 10                	mov    %edx,(%eax)
}
  108633:	90                   	nop
}
  108634:	90                   	nop
}
  108635:	90                   	nop
        show_buddy_array();
  108636:	e8 8c f6 ff ff       	call   107cc7 <show_buddy_array>
        buddy = buddy_find(left_block);
  10863b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10863e:	89 04 24             	mov    %eax,(%esp)
  108641:	e8 2e f9 ff ff       	call   107f74 <buddy_find>
  108646:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (!PageProperty(buddy) && left_block->property < max_order) 
  108649:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10864c:	83 c0 04             	add    $0x4,%eax
  10864f:	c7 45 8c 01 00 00 00 	movl   $0x1,-0x74(%ebp)
  108656:	89 45 88             	mov    %eax,-0x78(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  108659:	8b 45 88             	mov    -0x78(%ebp),%eax
  10865c:	8b 55 8c             	mov    -0x74(%ebp),%edx
  10865f:	0f a3 10             	bt     %edx,(%eax)
  108662:	19 c0                	sbb    %eax,%eax
  108664:	89 45 84             	mov    %eax,-0x7c(%ebp)
    return oldbit != 0;
  108667:	83 7d 84 00          	cmpl   $0x0,-0x7c(%ebp)
  10866b:	0f 95 c0             	setne  %al
  10866e:	0f b6 c0             	movzbl %al,%eax
  108671:	85 c0                	test   %eax,%eax
  108673:	75 13                	jne    108688 <buddy_free_pages+0x2a3>
  108675:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108678:	8b 50 08             	mov    0x8(%eax),%edx
  10867b:	a1 20 da 2a 00       	mov    0x2ada20,%eax
  108680:	39 c2                	cmp    %eax,%edx
  108682:	0f 82 96 fe ff ff    	jb     10851e <buddy_free_pages+0x139>
    }
    cprintf("[*]Core: Buddy array after FREE:\n");
  108688:	c7 04 24 6c ae 10 00 	movl   $0x10ae6c,(%esp)
  10868f:	e8 21 7c ff ff       	call   1002b5 <cprintf>
    ClearPageProperty(left_block);
  108694:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108697:	83 c0 04             	add    $0x4,%eax
  10869a:	c7 45 80 01 00 00 00 	movl   $0x1,-0x80(%ebp)
  1086a1:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  1086a7:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
  1086ad:	8b 55 80             	mov    -0x80(%ebp),%edx
  1086b0:	0f b3 10             	btr    %edx,(%eax)
}
  1086b3:	90                   	nop
    nr_free += pnum;
  1086b4:	8b 15 cc da 2a 00    	mov    0x2adacc,%edx
  1086ba:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1086bd:	01 d0                	add    %edx,%eax
  1086bf:	a3 cc da 2a 00       	mov    %eax,0x2adacc
    show_buddy_array();
  1086c4:	e8 fe f5 ff ff       	call   107cc7 <show_buddy_array>
    
    cprintf("[*]Core: nr_free: %d\n", nr_free);
  1086c9:	a1 cc da 2a 00       	mov    0x2adacc,%eax
  1086ce:	89 44 24 04          	mov    %eax,0x4(%esp)
  1086d2:	c7 04 24 d6 ad 10 00 	movl   $0x10add6,(%esp)
  1086d9:	e8 d7 7b ff ff       	call   1002b5 <cprintf>
    return;
  1086de:	90                   	nop
}
  1086df:	c9                   	leave  
  1086e0:	c3                   	ret    

001086e1 <buddy_nr_free_pages>:

static size_t buddy_nr_free_pages(void) 
{
  1086e1:	f3 0f 1e fb          	endbr32 
  1086e5:	55                   	push   %ebp
  1086e6:	89 e5                	mov    %esp,%ebp
    return nr_free;
  1086e8:	a1 cc da 2a 00       	mov    0x2adacc,%eax
}
  1086ed:	5d                   	pop    %ebp
  1086ee:	c3                   	ret    

001086ef <basic_check>:

static void basic_check(void) 
{
  1086ef:	f3 0f 1e fb          	endbr32 
  1086f3:	55                   	push   %ebp
  1086f4:	89 e5                	mov    %esp,%ebp
  1086f6:	83 ec 28             	sub    $0x28,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
  1086f9:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  108700:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108703:	89 45 f0             	mov    %eax,-0x10(%ebp)
  108706:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108709:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
  10870c:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  108713:	e8 bf b6 ff ff       	call   103dd7 <alloc_pages>
  108718:	89 45 ec             	mov    %eax,-0x14(%ebp)
  10871b:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  10871f:	75 24                	jne    108745 <basic_check+0x56>
  108721:	c7 44 24 0c 8e ae 10 	movl   $0x10ae8e,0xc(%esp)
  108728:	00 
  108729:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108730:	00 
  108731:	c7 44 24 04 e7 00 00 	movl   $0xe7,0x4(%esp)
  108738:	00 
  108739:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108740:	e8 dc 7c ff ff       	call   100421 <__panic>
    assert((p1 = alloc_page()) != NULL);
  108745:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10874c:	e8 86 b6 ff ff       	call   103dd7 <alloc_pages>
  108751:	89 45 f0             	mov    %eax,-0x10(%ebp)
  108754:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  108758:	75 24                	jne    10877e <basic_check+0x8f>
  10875a:	c7 44 24 0c aa ae 10 	movl   $0x10aeaa,0xc(%esp)
  108761:	00 
  108762:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108769:	00 
  10876a:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
  108771:	00 
  108772:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108779:	e8 a3 7c ff ff       	call   100421 <__panic>
    assert((p2 = alloc_page()) != NULL);
  10877e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  108785:	e8 4d b6 ff ff       	call   103dd7 <alloc_pages>
  10878a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  10878d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  108791:	75 24                	jne    1087b7 <basic_check+0xc8>
  108793:	c7 44 24 0c c6 ae 10 	movl   $0x10aec6,0xc(%esp)
  10879a:	00 
  10879b:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  1087a2:	00 
  1087a3:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
  1087aa:	00 
  1087ab:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  1087b2:	e8 6a 7c ff ff       	call   100421 <__panic>
    free_page(p0);
  1087b7:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1087be:	00 
  1087bf:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1087c2:	89 04 24             	mov    %eax,(%esp)
  1087c5:	e8 49 b6 ff ff       	call   103e13 <free_pages>
    free_page(p1);
  1087ca:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1087d1:	00 
  1087d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1087d5:	89 04 24             	mov    %eax,(%esp)
  1087d8:	e8 36 b6 ff ff       	call   103e13 <free_pages>
    free_page(p2);
  1087dd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1087e4:	00 
  1087e5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1087e8:	89 04 24             	mov    %eax,(%esp)
  1087eb:	e8 23 b6 ff ff       	call   103e13 <free_pages>
    show_buddy_array();
  1087f0:	e8 d2 f4 ff ff       	call   107cc7 <show_buddy_array>

    assert((p0 = alloc_pages(4)) != NULL);
  1087f5:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  1087fc:	e8 d6 b5 ff ff       	call   103dd7 <alloc_pages>
  108801:	89 45 ec             	mov    %eax,-0x14(%ebp)
  108804:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  108808:	75 24                	jne    10882e <basic_check+0x13f>
  10880a:	c7 44 24 0c e2 ae 10 	movl   $0x10aee2,0xc(%esp)
  108811:	00 
  108812:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108819:	00 
  10881a:	c7 44 24 04 ef 00 00 	movl   $0xef,0x4(%esp)
  108821:	00 
  108822:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108829:	e8 f3 7b ff ff       	call   100421 <__panic>
    assert((p1 = alloc_pages(2)) != NULL);
  10882e:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  108835:	e8 9d b5 ff ff       	call   103dd7 <alloc_pages>
  10883a:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10883d:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  108841:	75 24                	jne    108867 <basic_check+0x178>
  108843:	c7 44 24 0c 00 af 10 	movl   $0x10af00,0xc(%esp)
  10884a:	00 
  10884b:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108852:	00 
  108853:	c7 44 24 04 f0 00 00 	movl   $0xf0,0x4(%esp)
  10885a:	00 
  10885b:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108862:	e8 ba 7b ff ff       	call   100421 <__panic>
    assert((p2 = alloc_pages(1)) != NULL);
  108867:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10886e:	e8 64 b5 ff ff       	call   103dd7 <alloc_pages>
  108873:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108876:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10887a:	75 24                	jne    1088a0 <basic_check+0x1b1>
  10887c:	c7 44 24 0c 1e af 10 	movl   $0x10af1e,0xc(%esp)
  108883:	00 
  108884:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  10888b:	00 
  10888c:	c7 44 24 04 f1 00 00 	movl   $0xf1,0x4(%esp)
  108893:	00 
  108894:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  10889b:	e8 81 7b ff ff       	call   100421 <__panic>
    free_pages(p0, 4);
  1088a0:	c7 44 24 04 04 00 00 	movl   $0x4,0x4(%esp)
  1088a7:	00 
  1088a8:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1088ab:	89 04 24             	mov    %eax,(%esp)
  1088ae:	e8 60 b5 ff ff       	call   103e13 <free_pages>
    free_pages(p1, 2);
  1088b3:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  1088ba:	00 
  1088bb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1088be:	89 04 24             	mov    %eax,(%esp)
  1088c1:	e8 4d b5 ff ff       	call   103e13 <free_pages>
    free_pages(p2, 1);
  1088c6:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1088cd:	00 
  1088ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1088d1:	89 04 24             	mov    %eax,(%esp)
  1088d4:	e8 3a b5 ff ff       	call   103e13 <free_pages>
    show_buddy_array();
  1088d9:	e8 e9 f3 ff ff       	call   107cc7 <show_buddy_array>

    assert((p0 = alloc_pages(3)) != NULL);
  1088de:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  1088e5:	e8 ed b4 ff ff       	call   103dd7 <alloc_pages>
  1088ea:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1088ed:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  1088f1:	75 24                	jne    108917 <basic_check+0x228>
  1088f3:	c7 44 24 0c 3c af 10 	movl   $0x10af3c,0xc(%esp)
  1088fa:	00 
  1088fb:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  108902:	00 
  108903:	c7 44 24 04 f7 00 00 	movl   $0xf7,0x4(%esp)
  10890a:	00 
  10890b:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  108912:	e8 0a 7b ff ff       	call   100421 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
  108917:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  10891e:	e8 b4 b4 ff ff       	call   103dd7 <alloc_pages>
  108923:	89 45 f0             	mov    %eax,-0x10(%ebp)
  108926:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  10892a:	75 24                	jne    108950 <basic_check+0x261>
  10892c:	c7 44 24 0c 5a af 10 	movl   $0x10af5a,0xc(%esp)
  108933:	00 
  108934:	c7 44 24 08 47 ac 10 	movl   $0x10ac47,0x8(%esp)
  10893b:	00 
  10893c:	c7 44 24 04 f8 00 00 	movl   $0xf8,0x4(%esp)
  108943:	00 
  108944:	c7 04 24 5c ac 10 00 	movl   $0x10ac5c,(%esp)
  10894b:	e8 d1 7a ff ff       	call   100421 <__panic>
    free_pages(p0, 3);
  108950:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  108957:	00 
  108958:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10895b:	89 04 24             	mov    %eax,(%esp)
  10895e:	e8 b0 b4 ff ff       	call   103e13 <free_pages>
    free_pages(p1, 3);
  108963:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  10896a:	00 
  10896b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10896e:	89 04 24             	mov    %eax,(%esp)
  108971:	e8 9d b4 ff ff       	call   103e13 <free_pages>

    show_buddy_array();
  108976:	e8 4c f3 ff ff       	call   107cc7 <show_buddy_array>
    cprintf("buddy_check success!");
  10897b:	c7 04 24 78 af 10 00 	movl   $0x10af78,(%esp)
  108982:	e8 2e 79 ff ff       	call   1002b5 <cprintf>
}
  108987:	90                   	nop
  108988:	c9                   	leave  
  108989:	c3                   	ret    

0010898a <buddy_check>:

static void buddy_check(void) 
{
  10898a:	f3 0f 1e fb          	endbr32 
  10898e:	55                   	push   %ebp
  10898f:	89 e5                	mov    %esp,%ebp
  108991:	83 ec 08             	sub    $0x8,%esp
    basic_check();
  108994:	e8 56 fd ff ff       	call   1086ef <basic_check>
}
  108999:	90                   	nop
  10899a:	c9                   	leave  
  10899b:	c3                   	ret    

0010899c <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
  10899c:	f3 0f 1e fb          	endbr32 
  1089a0:	55                   	push   %ebp
  1089a1:	89 e5                	mov    %esp,%ebp
  1089a3:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  1089a6:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
  1089ad:	eb 03                	jmp    1089b2 <strlen+0x16>
        cnt ++;
  1089af:	ff 45 fc             	incl   -0x4(%ebp)
    while (*s ++ != '\0') {
  1089b2:	8b 45 08             	mov    0x8(%ebp),%eax
  1089b5:	8d 50 01             	lea    0x1(%eax),%edx
  1089b8:	89 55 08             	mov    %edx,0x8(%ebp)
  1089bb:	0f b6 00             	movzbl (%eax),%eax
  1089be:	84 c0                	test   %al,%al
  1089c0:	75 ed                	jne    1089af <strlen+0x13>
    }
    return cnt;
  1089c2:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1089c5:	c9                   	leave  
  1089c6:	c3                   	ret    

001089c7 <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
  1089c7:	f3 0f 1e fb          	endbr32 
  1089cb:	55                   	push   %ebp
  1089cc:	89 e5                	mov    %esp,%ebp
  1089ce:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  1089d1:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  1089d8:	eb 03                	jmp    1089dd <strnlen+0x16>
        cnt ++;
  1089da:	ff 45 fc             	incl   -0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  1089dd:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1089e0:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1089e3:	73 10                	jae    1089f5 <strnlen+0x2e>
  1089e5:	8b 45 08             	mov    0x8(%ebp),%eax
  1089e8:	8d 50 01             	lea    0x1(%eax),%edx
  1089eb:	89 55 08             	mov    %edx,0x8(%ebp)
  1089ee:	0f b6 00             	movzbl (%eax),%eax
  1089f1:	84 c0                	test   %al,%al
  1089f3:	75 e5                	jne    1089da <strnlen+0x13>
    }
    return cnt;
  1089f5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1089f8:	c9                   	leave  
  1089f9:	c3                   	ret    

001089fa <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
  1089fa:	f3 0f 1e fb          	endbr32 
  1089fe:	55                   	push   %ebp
  1089ff:	89 e5                	mov    %esp,%ebp
  108a01:	57                   	push   %edi
  108a02:	56                   	push   %esi
  108a03:	83 ec 20             	sub    $0x20,%esp
  108a06:	8b 45 08             	mov    0x8(%ebp),%eax
  108a09:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108a0c:	8b 45 0c             	mov    0xc(%ebp),%eax
  108a0f:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
  108a12:	8b 55 f0             	mov    -0x10(%ebp),%edx
  108a15:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108a18:	89 d1                	mov    %edx,%ecx
  108a1a:	89 c2                	mov    %eax,%edx
  108a1c:	89 ce                	mov    %ecx,%esi
  108a1e:	89 d7                	mov    %edx,%edi
  108a20:	ac                   	lods   %ds:(%esi),%al
  108a21:	aa                   	stos   %al,%es:(%edi)
  108a22:	84 c0                	test   %al,%al
  108a24:	75 fa                	jne    108a20 <strcpy+0x26>
  108a26:	89 fa                	mov    %edi,%edx
  108a28:	89 f1                	mov    %esi,%ecx
  108a2a:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  108a2d:	89 55 e8             	mov    %edx,-0x18(%ebp)
  108a30:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
  108a33:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
  108a36:	83 c4 20             	add    $0x20,%esp
  108a39:	5e                   	pop    %esi
  108a3a:	5f                   	pop    %edi
  108a3b:	5d                   	pop    %ebp
  108a3c:	c3                   	ret    

00108a3d <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
  108a3d:	f3 0f 1e fb          	endbr32 
  108a41:	55                   	push   %ebp
  108a42:	89 e5                	mov    %esp,%ebp
  108a44:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
  108a47:	8b 45 08             	mov    0x8(%ebp),%eax
  108a4a:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
  108a4d:	eb 1e                	jmp    108a6d <strncpy+0x30>
        if ((*p = *src) != '\0') {
  108a4f:	8b 45 0c             	mov    0xc(%ebp),%eax
  108a52:	0f b6 10             	movzbl (%eax),%edx
  108a55:	8b 45 fc             	mov    -0x4(%ebp),%eax
  108a58:	88 10                	mov    %dl,(%eax)
  108a5a:	8b 45 fc             	mov    -0x4(%ebp),%eax
  108a5d:	0f b6 00             	movzbl (%eax),%eax
  108a60:	84 c0                	test   %al,%al
  108a62:	74 03                	je     108a67 <strncpy+0x2a>
            src ++;
  108a64:	ff 45 0c             	incl   0xc(%ebp)
        }
        p ++, len --;
  108a67:	ff 45 fc             	incl   -0x4(%ebp)
  108a6a:	ff 4d 10             	decl   0x10(%ebp)
    while (len > 0) {
  108a6d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  108a71:	75 dc                	jne    108a4f <strncpy+0x12>
    }
    return dst;
  108a73:	8b 45 08             	mov    0x8(%ebp),%eax
}
  108a76:	c9                   	leave  
  108a77:	c3                   	ret    

00108a78 <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
  108a78:	f3 0f 1e fb          	endbr32 
  108a7c:	55                   	push   %ebp
  108a7d:	89 e5                	mov    %esp,%ebp
  108a7f:	57                   	push   %edi
  108a80:	56                   	push   %esi
  108a81:	83 ec 20             	sub    $0x20,%esp
  108a84:	8b 45 08             	mov    0x8(%ebp),%eax
  108a87:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108a8a:	8b 45 0c             	mov    0xc(%ebp),%eax
  108a8d:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
  108a90:	8b 55 f4             	mov    -0xc(%ebp),%edx
  108a93:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108a96:	89 d1                	mov    %edx,%ecx
  108a98:	89 c2                	mov    %eax,%edx
  108a9a:	89 ce                	mov    %ecx,%esi
  108a9c:	89 d7                	mov    %edx,%edi
  108a9e:	ac                   	lods   %ds:(%esi),%al
  108a9f:	ae                   	scas   %es:(%edi),%al
  108aa0:	75 08                	jne    108aaa <strcmp+0x32>
  108aa2:	84 c0                	test   %al,%al
  108aa4:	75 f8                	jne    108a9e <strcmp+0x26>
  108aa6:	31 c0                	xor    %eax,%eax
  108aa8:	eb 04                	jmp    108aae <strcmp+0x36>
  108aaa:	19 c0                	sbb    %eax,%eax
  108aac:	0c 01                	or     $0x1,%al
  108aae:	89 fa                	mov    %edi,%edx
  108ab0:	89 f1                	mov    %esi,%ecx
  108ab2:	89 45 ec             	mov    %eax,-0x14(%ebp)
  108ab5:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  108ab8:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
  108abb:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
  108abe:	83 c4 20             	add    $0x20,%esp
  108ac1:	5e                   	pop    %esi
  108ac2:	5f                   	pop    %edi
  108ac3:	5d                   	pop    %ebp
  108ac4:	c3                   	ret    

00108ac5 <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
  108ac5:	f3 0f 1e fb          	endbr32 
  108ac9:	55                   	push   %ebp
  108aca:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  108acc:	eb 09                	jmp    108ad7 <strncmp+0x12>
        n --, s1 ++, s2 ++;
  108ace:	ff 4d 10             	decl   0x10(%ebp)
  108ad1:	ff 45 08             	incl   0x8(%ebp)
  108ad4:	ff 45 0c             	incl   0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  108ad7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  108adb:	74 1a                	je     108af7 <strncmp+0x32>
  108add:	8b 45 08             	mov    0x8(%ebp),%eax
  108ae0:	0f b6 00             	movzbl (%eax),%eax
  108ae3:	84 c0                	test   %al,%al
  108ae5:	74 10                	je     108af7 <strncmp+0x32>
  108ae7:	8b 45 08             	mov    0x8(%ebp),%eax
  108aea:	0f b6 10             	movzbl (%eax),%edx
  108aed:	8b 45 0c             	mov    0xc(%ebp),%eax
  108af0:	0f b6 00             	movzbl (%eax),%eax
  108af3:	38 c2                	cmp    %al,%dl
  108af5:	74 d7                	je     108ace <strncmp+0x9>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
  108af7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  108afb:	74 18                	je     108b15 <strncmp+0x50>
  108afd:	8b 45 08             	mov    0x8(%ebp),%eax
  108b00:	0f b6 00             	movzbl (%eax),%eax
  108b03:	0f b6 d0             	movzbl %al,%edx
  108b06:	8b 45 0c             	mov    0xc(%ebp),%eax
  108b09:	0f b6 00             	movzbl (%eax),%eax
  108b0c:	0f b6 c0             	movzbl %al,%eax
  108b0f:	29 c2                	sub    %eax,%edx
  108b11:	89 d0                	mov    %edx,%eax
  108b13:	eb 05                	jmp    108b1a <strncmp+0x55>
  108b15:	b8 00 00 00 00       	mov    $0x0,%eax
}
  108b1a:	5d                   	pop    %ebp
  108b1b:	c3                   	ret    

00108b1c <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
  108b1c:	f3 0f 1e fb          	endbr32 
  108b20:	55                   	push   %ebp
  108b21:	89 e5                	mov    %esp,%ebp
  108b23:	83 ec 04             	sub    $0x4,%esp
  108b26:	8b 45 0c             	mov    0xc(%ebp),%eax
  108b29:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  108b2c:	eb 13                	jmp    108b41 <strchr+0x25>
        if (*s == c) {
  108b2e:	8b 45 08             	mov    0x8(%ebp),%eax
  108b31:	0f b6 00             	movzbl (%eax),%eax
  108b34:	38 45 fc             	cmp    %al,-0x4(%ebp)
  108b37:	75 05                	jne    108b3e <strchr+0x22>
            return (char *)s;
  108b39:	8b 45 08             	mov    0x8(%ebp),%eax
  108b3c:	eb 12                	jmp    108b50 <strchr+0x34>
        }
        s ++;
  108b3e:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
  108b41:	8b 45 08             	mov    0x8(%ebp),%eax
  108b44:	0f b6 00             	movzbl (%eax),%eax
  108b47:	84 c0                	test   %al,%al
  108b49:	75 e3                	jne    108b2e <strchr+0x12>
    }
    return NULL;
  108b4b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  108b50:	c9                   	leave  
  108b51:	c3                   	ret    

00108b52 <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
  108b52:	f3 0f 1e fb          	endbr32 
  108b56:	55                   	push   %ebp
  108b57:	89 e5                	mov    %esp,%ebp
  108b59:	83 ec 04             	sub    $0x4,%esp
  108b5c:	8b 45 0c             	mov    0xc(%ebp),%eax
  108b5f:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  108b62:	eb 0e                	jmp    108b72 <strfind+0x20>
        if (*s == c) {
  108b64:	8b 45 08             	mov    0x8(%ebp),%eax
  108b67:	0f b6 00             	movzbl (%eax),%eax
  108b6a:	38 45 fc             	cmp    %al,-0x4(%ebp)
  108b6d:	74 0f                	je     108b7e <strfind+0x2c>
            break;
        }
        s ++;
  108b6f:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
  108b72:	8b 45 08             	mov    0x8(%ebp),%eax
  108b75:	0f b6 00             	movzbl (%eax),%eax
  108b78:	84 c0                	test   %al,%al
  108b7a:	75 e8                	jne    108b64 <strfind+0x12>
  108b7c:	eb 01                	jmp    108b7f <strfind+0x2d>
            break;
  108b7e:	90                   	nop
    }
    return (char *)s;
  108b7f:	8b 45 08             	mov    0x8(%ebp),%eax
}
  108b82:	c9                   	leave  
  108b83:	c3                   	ret    

00108b84 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
  108b84:	f3 0f 1e fb          	endbr32 
  108b88:	55                   	push   %ebp
  108b89:	89 e5                	mov    %esp,%ebp
  108b8b:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
  108b8e:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
  108b95:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
  108b9c:	eb 03                	jmp    108ba1 <strtol+0x1d>
        s ++;
  108b9e:	ff 45 08             	incl   0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
  108ba1:	8b 45 08             	mov    0x8(%ebp),%eax
  108ba4:	0f b6 00             	movzbl (%eax),%eax
  108ba7:	3c 20                	cmp    $0x20,%al
  108ba9:	74 f3                	je     108b9e <strtol+0x1a>
  108bab:	8b 45 08             	mov    0x8(%ebp),%eax
  108bae:	0f b6 00             	movzbl (%eax),%eax
  108bb1:	3c 09                	cmp    $0x9,%al
  108bb3:	74 e9                	je     108b9e <strtol+0x1a>
    }

    // plus/minus sign
    if (*s == '+') {
  108bb5:	8b 45 08             	mov    0x8(%ebp),%eax
  108bb8:	0f b6 00             	movzbl (%eax),%eax
  108bbb:	3c 2b                	cmp    $0x2b,%al
  108bbd:	75 05                	jne    108bc4 <strtol+0x40>
        s ++;
  108bbf:	ff 45 08             	incl   0x8(%ebp)
  108bc2:	eb 14                	jmp    108bd8 <strtol+0x54>
    }
    else if (*s == '-') {
  108bc4:	8b 45 08             	mov    0x8(%ebp),%eax
  108bc7:	0f b6 00             	movzbl (%eax),%eax
  108bca:	3c 2d                	cmp    $0x2d,%al
  108bcc:	75 0a                	jne    108bd8 <strtol+0x54>
        s ++, neg = 1;
  108bce:	ff 45 08             	incl   0x8(%ebp)
  108bd1:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
  108bd8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  108bdc:	74 06                	je     108be4 <strtol+0x60>
  108bde:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
  108be2:	75 22                	jne    108c06 <strtol+0x82>
  108be4:	8b 45 08             	mov    0x8(%ebp),%eax
  108be7:	0f b6 00             	movzbl (%eax),%eax
  108bea:	3c 30                	cmp    $0x30,%al
  108bec:	75 18                	jne    108c06 <strtol+0x82>
  108bee:	8b 45 08             	mov    0x8(%ebp),%eax
  108bf1:	40                   	inc    %eax
  108bf2:	0f b6 00             	movzbl (%eax),%eax
  108bf5:	3c 78                	cmp    $0x78,%al
  108bf7:	75 0d                	jne    108c06 <strtol+0x82>
        s += 2, base = 16;
  108bf9:	83 45 08 02          	addl   $0x2,0x8(%ebp)
  108bfd:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
  108c04:	eb 29                	jmp    108c2f <strtol+0xab>
    }
    else if (base == 0 && s[0] == '0') {
  108c06:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  108c0a:	75 16                	jne    108c22 <strtol+0x9e>
  108c0c:	8b 45 08             	mov    0x8(%ebp),%eax
  108c0f:	0f b6 00             	movzbl (%eax),%eax
  108c12:	3c 30                	cmp    $0x30,%al
  108c14:	75 0c                	jne    108c22 <strtol+0x9e>
        s ++, base = 8;
  108c16:	ff 45 08             	incl   0x8(%ebp)
  108c19:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
  108c20:	eb 0d                	jmp    108c2f <strtol+0xab>
    }
    else if (base == 0) {
  108c22:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  108c26:	75 07                	jne    108c2f <strtol+0xab>
        base = 10;
  108c28:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
  108c2f:	8b 45 08             	mov    0x8(%ebp),%eax
  108c32:	0f b6 00             	movzbl (%eax),%eax
  108c35:	3c 2f                	cmp    $0x2f,%al
  108c37:	7e 1b                	jle    108c54 <strtol+0xd0>
  108c39:	8b 45 08             	mov    0x8(%ebp),%eax
  108c3c:	0f b6 00             	movzbl (%eax),%eax
  108c3f:	3c 39                	cmp    $0x39,%al
  108c41:	7f 11                	jg     108c54 <strtol+0xd0>
            dig = *s - '0';
  108c43:	8b 45 08             	mov    0x8(%ebp),%eax
  108c46:	0f b6 00             	movzbl (%eax),%eax
  108c49:	0f be c0             	movsbl %al,%eax
  108c4c:	83 e8 30             	sub    $0x30,%eax
  108c4f:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108c52:	eb 48                	jmp    108c9c <strtol+0x118>
        }
        else if (*s >= 'a' && *s <= 'z') {
  108c54:	8b 45 08             	mov    0x8(%ebp),%eax
  108c57:	0f b6 00             	movzbl (%eax),%eax
  108c5a:	3c 60                	cmp    $0x60,%al
  108c5c:	7e 1b                	jle    108c79 <strtol+0xf5>
  108c5e:	8b 45 08             	mov    0x8(%ebp),%eax
  108c61:	0f b6 00             	movzbl (%eax),%eax
  108c64:	3c 7a                	cmp    $0x7a,%al
  108c66:	7f 11                	jg     108c79 <strtol+0xf5>
            dig = *s - 'a' + 10;
  108c68:	8b 45 08             	mov    0x8(%ebp),%eax
  108c6b:	0f b6 00             	movzbl (%eax),%eax
  108c6e:	0f be c0             	movsbl %al,%eax
  108c71:	83 e8 57             	sub    $0x57,%eax
  108c74:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108c77:	eb 23                	jmp    108c9c <strtol+0x118>
        }
        else if (*s >= 'A' && *s <= 'Z') {
  108c79:	8b 45 08             	mov    0x8(%ebp),%eax
  108c7c:	0f b6 00             	movzbl (%eax),%eax
  108c7f:	3c 40                	cmp    $0x40,%al
  108c81:	7e 3b                	jle    108cbe <strtol+0x13a>
  108c83:	8b 45 08             	mov    0x8(%ebp),%eax
  108c86:	0f b6 00             	movzbl (%eax),%eax
  108c89:	3c 5a                	cmp    $0x5a,%al
  108c8b:	7f 31                	jg     108cbe <strtol+0x13a>
            dig = *s - 'A' + 10;
  108c8d:	8b 45 08             	mov    0x8(%ebp),%eax
  108c90:	0f b6 00             	movzbl (%eax),%eax
  108c93:	0f be c0             	movsbl %al,%eax
  108c96:	83 e8 37             	sub    $0x37,%eax
  108c99:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
  108c9c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108c9f:	3b 45 10             	cmp    0x10(%ebp),%eax
  108ca2:	7d 19                	jge    108cbd <strtol+0x139>
            break;
        }
        s ++, val = (val * base) + dig;
  108ca4:	ff 45 08             	incl   0x8(%ebp)
  108ca7:	8b 45 f8             	mov    -0x8(%ebp),%eax
  108caa:	0f af 45 10          	imul   0x10(%ebp),%eax
  108cae:	89 c2                	mov    %eax,%edx
  108cb0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  108cb3:	01 d0                	add    %edx,%eax
  108cb5:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
  108cb8:	e9 72 ff ff ff       	jmp    108c2f <strtol+0xab>
            break;
  108cbd:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
  108cbe:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  108cc2:	74 08                	je     108ccc <strtol+0x148>
        *endptr = (char *) s;
  108cc4:	8b 45 0c             	mov    0xc(%ebp),%eax
  108cc7:	8b 55 08             	mov    0x8(%ebp),%edx
  108cca:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
  108ccc:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
  108cd0:	74 07                	je     108cd9 <strtol+0x155>
  108cd2:	8b 45 f8             	mov    -0x8(%ebp),%eax
  108cd5:	f7 d8                	neg    %eax
  108cd7:	eb 03                	jmp    108cdc <strtol+0x158>
  108cd9:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
  108cdc:	c9                   	leave  
  108cdd:	c3                   	ret    

00108cde <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
  108cde:	f3 0f 1e fb          	endbr32 
  108ce2:	55                   	push   %ebp
  108ce3:	89 e5                	mov    %esp,%ebp
  108ce5:	57                   	push   %edi
  108ce6:	83 ec 24             	sub    $0x24,%esp
  108ce9:	8b 45 0c             	mov    0xc(%ebp),%eax
  108cec:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
  108cef:	0f be 55 d8          	movsbl -0x28(%ebp),%edx
  108cf3:	8b 45 08             	mov    0x8(%ebp),%eax
  108cf6:	89 45 f8             	mov    %eax,-0x8(%ebp)
  108cf9:	88 55 f7             	mov    %dl,-0x9(%ebp)
  108cfc:	8b 45 10             	mov    0x10(%ebp),%eax
  108cff:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
  108d02:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  108d05:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
  108d09:	8b 55 f8             	mov    -0x8(%ebp),%edx
  108d0c:	89 d7                	mov    %edx,%edi
  108d0e:	f3 aa                	rep stos %al,%es:(%edi)
  108d10:	89 fa                	mov    %edi,%edx
  108d12:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  108d15:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
  108d18:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
  108d1b:	83 c4 24             	add    $0x24,%esp
  108d1e:	5f                   	pop    %edi
  108d1f:	5d                   	pop    %ebp
  108d20:	c3                   	ret    

00108d21 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
  108d21:	f3 0f 1e fb          	endbr32 
  108d25:	55                   	push   %ebp
  108d26:	89 e5                	mov    %esp,%ebp
  108d28:	57                   	push   %edi
  108d29:	56                   	push   %esi
  108d2a:	53                   	push   %ebx
  108d2b:	83 ec 30             	sub    $0x30,%esp
  108d2e:	8b 45 08             	mov    0x8(%ebp),%eax
  108d31:	89 45 f0             	mov    %eax,-0x10(%ebp)
  108d34:	8b 45 0c             	mov    0xc(%ebp),%eax
  108d37:	89 45 ec             	mov    %eax,-0x14(%ebp)
  108d3a:	8b 45 10             	mov    0x10(%ebp),%eax
  108d3d:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
  108d40:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108d43:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  108d46:	73 42                	jae    108d8a <memmove+0x69>
  108d48:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108d4b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  108d4e:	8b 45 ec             	mov    -0x14(%ebp),%eax
  108d51:	89 45 e0             	mov    %eax,-0x20(%ebp)
  108d54:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108d57:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  108d5a:	8b 45 dc             	mov    -0x24(%ebp),%eax
  108d5d:	c1 e8 02             	shr    $0x2,%eax
  108d60:	89 c1                	mov    %eax,%ecx
    asm volatile (
  108d62:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  108d65:	8b 45 e0             	mov    -0x20(%ebp),%eax
  108d68:	89 d7                	mov    %edx,%edi
  108d6a:	89 c6                	mov    %eax,%esi
  108d6c:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  108d6e:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  108d71:	83 e1 03             	and    $0x3,%ecx
  108d74:	74 02                	je     108d78 <memmove+0x57>
  108d76:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  108d78:	89 f0                	mov    %esi,%eax
  108d7a:	89 fa                	mov    %edi,%edx
  108d7c:	89 4d d8             	mov    %ecx,-0x28(%ebp)
  108d7f:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  108d82:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
  108d85:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
  108d88:	eb 36                	jmp    108dc0 <memmove+0x9f>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
  108d8a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108d8d:	8d 50 ff             	lea    -0x1(%eax),%edx
  108d90:	8b 45 ec             	mov    -0x14(%ebp),%eax
  108d93:	01 c2                	add    %eax,%edx
  108d95:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108d98:	8d 48 ff             	lea    -0x1(%eax),%ecx
  108d9b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108d9e:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
  108da1:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108da4:	89 c1                	mov    %eax,%ecx
  108da6:	89 d8                	mov    %ebx,%eax
  108da8:	89 d6                	mov    %edx,%esi
  108daa:	89 c7                	mov    %eax,%edi
  108dac:	fd                   	std    
  108dad:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  108daf:	fc                   	cld    
  108db0:	89 f8                	mov    %edi,%eax
  108db2:	89 f2                	mov    %esi,%edx
  108db4:	89 4d cc             	mov    %ecx,-0x34(%ebp)
  108db7:	89 55 c8             	mov    %edx,-0x38(%ebp)
  108dba:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
  108dbd:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
  108dc0:	83 c4 30             	add    $0x30,%esp
  108dc3:	5b                   	pop    %ebx
  108dc4:	5e                   	pop    %esi
  108dc5:	5f                   	pop    %edi
  108dc6:	5d                   	pop    %ebp
  108dc7:	c3                   	ret    

00108dc8 <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
  108dc8:	f3 0f 1e fb          	endbr32 
  108dcc:	55                   	push   %ebp
  108dcd:	89 e5                	mov    %esp,%ebp
  108dcf:	57                   	push   %edi
  108dd0:	56                   	push   %esi
  108dd1:	83 ec 20             	sub    $0x20,%esp
  108dd4:	8b 45 08             	mov    0x8(%ebp),%eax
  108dd7:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108dda:	8b 45 0c             	mov    0xc(%ebp),%eax
  108ddd:	89 45 f0             	mov    %eax,-0x10(%ebp)
  108de0:	8b 45 10             	mov    0x10(%ebp),%eax
  108de3:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  108de6:	8b 45 ec             	mov    -0x14(%ebp),%eax
  108de9:	c1 e8 02             	shr    $0x2,%eax
  108dec:	89 c1                	mov    %eax,%ecx
    asm volatile (
  108dee:	8b 55 f4             	mov    -0xc(%ebp),%edx
  108df1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108df4:	89 d7                	mov    %edx,%edi
  108df6:	89 c6                	mov    %eax,%esi
  108df8:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  108dfa:	8b 4d ec             	mov    -0x14(%ebp),%ecx
  108dfd:	83 e1 03             	and    $0x3,%ecx
  108e00:	74 02                	je     108e04 <memcpy+0x3c>
  108e02:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  108e04:	89 f0                	mov    %esi,%eax
  108e06:	89 fa                	mov    %edi,%edx
  108e08:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  108e0b:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  108e0e:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
  108e11:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
  108e14:	83 c4 20             	add    $0x20,%esp
  108e17:	5e                   	pop    %esi
  108e18:	5f                   	pop    %edi
  108e19:	5d                   	pop    %ebp
  108e1a:	c3                   	ret    

00108e1b <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
  108e1b:	f3 0f 1e fb          	endbr32 
  108e1f:	55                   	push   %ebp
  108e20:	89 e5                	mov    %esp,%ebp
  108e22:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
  108e25:	8b 45 08             	mov    0x8(%ebp),%eax
  108e28:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
  108e2b:	8b 45 0c             	mov    0xc(%ebp),%eax
  108e2e:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
  108e31:	eb 2e                	jmp    108e61 <memcmp+0x46>
        if (*s1 != *s2) {
  108e33:	8b 45 fc             	mov    -0x4(%ebp),%eax
  108e36:	0f b6 10             	movzbl (%eax),%edx
  108e39:	8b 45 f8             	mov    -0x8(%ebp),%eax
  108e3c:	0f b6 00             	movzbl (%eax),%eax
  108e3f:	38 c2                	cmp    %al,%dl
  108e41:	74 18                	je     108e5b <memcmp+0x40>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
  108e43:	8b 45 fc             	mov    -0x4(%ebp),%eax
  108e46:	0f b6 00             	movzbl (%eax),%eax
  108e49:	0f b6 d0             	movzbl %al,%edx
  108e4c:	8b 45 f8             	mov    -0x8(%ebp),%eax
  108e4f:	0f b6 00             	movzbl (%eax),%eax
  108e52:	0f b6 c0             	movzbl %al,%eax
  108e55:	29 c2                	sub    %eax,%edx
  108e57:	89 d0                	mov    %edx,%eax
  108e59:	eb 18                	jmp    108e73 <memcmp+0x58>
        }
        s1 ++, s2 ++;
  108e5b:	ff 45 fc             	incl   -0x4(%ebp)
  108e5e:	ff 45 f8             	incl   -0x8(%ebp)
    while (n -- > 0) {
  108e61:	8b 45 10             	mov    0x10(%ebp),%eax
  108e64:	8d 50 ff             	lea    -0x1(%eax),%edx
  108e67:	89 55 10             	mov    %edx,0x10(%ebp)
  108e6a:	85 c0                	test   %eax,%eax
  108e6c:	75 c5                	jne    108e33 <memcmp+0x18>
    }
    return 0;
  108e6e:	b8 00 00 00 00       	mov    $0x0,%eax
}
  108e73:	c9                   	leave  
  108e74:	c3                   	ret    

00108e75 <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
  108e75:	f3 0f 1e fb          	endbr32 
  108e79:	55                   	push   %ebp
  108e7a:	89 e5                	mov    %esp,%ebp
  108e7c:	83 ec 58             	sub    $0x58,%esp
  108e7f:	8b 45 10             	mov    0x10(%ebp),%eax
  108e82:	89 45 d0             	mov    %eax,-0x30(%ebp)
  108e85:	8b 45 14             	mov    0x14(%ebp),%eax
  108e88:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
  108e8b:	8b 45 d0             	mov    -0x30(%ebp),%eax
  108e8e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  108e91:	89 45 e8             	mov    %eax,-0x18(%ebp)
  108e94:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
  108e97:	8b 45 18             	mov    0x18(%ebp),%eax
  108e9a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  108e9d:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108ea0:	8b 55 ec             	mov    -0x14(%ebp),%edx
  108ea3:	89 45 e0             	mov    %eax,-0x20(%ebp)
  108ea6:	89 55 f0             	mov    %edx,-0x10(%ebp)
  108ea9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108eac:	89 45 f4             	mov    %eax,-0xc(%ebp)
  108eaf:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  108eb3:	74 1c                	je     108ed1 <printnum+0x5c>
  108eb5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108eb8:	ba 00 00 00 00       	mov    $0x0,%edx
  108ebd:	f7 75 e4             	divl   -0x1c(%ebp)
  108ec0:	89 55 f4             	mov    %edx,-0xc(%ebp)
  108ec3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  108ec6:	ba 00 00 00 00       	mov    $0x0,%edx
  108ecb:	f7 75 e4             	divl   -0x1c(%ebp)
  108ece:	89 45 f0             	mov    %eax,-0x10(%ebp)
  108ed1:	8b 45 e0             	mov    -0x20(%ebp),%eax
  108ed4:	8b 55 f4             	mov    -0xc(%ebp),%edx
  108ed7:	f7 75 e4             	divl   -0x1c(%ebp)
  108eda:	89 45 e0             	mov    %eax,-0x20(%ebp)
  108edd:	89 55 dc             	mov    %edx,-0x24(%ebp)
  108ee0:	8b 45 e0             	mov    -0x20(%ebp),%eax
  108ee3:	8b 55 f0             	mov    -0x10(%ebp),%edx
  108ee6:	89 45 e8             	mov    %eax,-0x18(%ebp)
  108ee9:	89 55 ec             	mov    %edx,-0x14(%ebp)
  108eec:	8b 45 dc             	mov    -0x24(%ebp),%eax
  108eef:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
  108ef2:	8b 45 18             	mov    0x18(%ebp),%eax
  108ef5:	ba 00 00 00 00       	mov    $0x0,%edx
  108efa:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  108efd:	39 45 d0             	cmp    %eax,-0x30(%ebp)
  108f00:	19 d1                	sbb    %edx,%ecx
  108f02:	72 4c                	jb     108f50 <printnum+0xdb>
        printnum(putch, putdat, result, base, width - 1, padc);
  108f04:	8b 45 1c             	mov    0x1c(%ebp),%eax
  108f07:	8d 50 ff             	lea    -0x1(%eax),%edx
  108f0a:	8b 45 20             	mov    0x20(%ebp),%eax
  108f0d:	89 44 24 18          	mov    %eax,0x18(%esp)
  108f11:	89 54 24 14          	mov    %edx,0x14(%esp)
  108f15:	8b 45 18             	mov    0x18(%ebp),%eax
  108f18:	89 44 24 10          	mov    %eax,0x10(%esp)
  108f1c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  108f1f:	8b 55 ec             	mov    -0x14(%ebp),%edx
  108f22:	89 44 24 08          	mov    %eax,0x8(%esp)
  108f26:	89 54 24 0c          	mov    %edx,0xc(%esp)
  108f2a:	8b 45 0c             	mov    0xc(%ebp),%eax
  108f2d:	89 44 24 04          	mov    %eax,0x4(%esp)
  108f31:	8b 45 08             	mov    0x8(%ebp),%eax
  108f34:	89 04 24             	mov    %eax,(%esp)
  108f37:	e8 39 ff ff ff       	call   108e75 <printnum>
  108f3c:	eb 1b                	jmp    108f59 <printnum+0xe4>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
  108f3e:	8b 45 0c             	mov    0xc(%ebp),%eax
  108f41:	89 44 24 04          	mov    %eax,0x4(%esp)
  108f45:	8b 45 20             	mov    0x20(%ebp),%eax
  108f48:	89 04 24             	mov    %eax,(%esp)
  108f4b:	8b 45 08             	mov    0x8(%ebp),%eax
  108f4e:	ff d0                	call   *%eax
        while (-- width > 0)
  108f50:	ff 4d 1c             	decl   0x1c(%ebp)
  108f53:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  108f57:	7f e5                	jg     108f3e <printnum+0xc9>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
  108f59:	8b 45 d8             	mov    -0x28(%ebp),%eax
  108f5c:	05 3c b0 10 00       	add    $0x10b03c,%eax
  108f61:	0f b6 00             	movzbl (%eax),%eax
  108f64:	0f be c0             	movsbl %al,%eax
  108f67:	8b 55 0c             	mov    0xc(%ebp),%edx
  108f6a:	89 54 24 04          	mov    %edx,0x4(%esp)
  108f6e:	89 04 24             	mov    %eax,(%esp)
  108f71:	8b 45 08             	mov    0x8(%ebp),%eax
  108f74:	ff d0                	call   *%eax
}
  108f76:	90                   	nop
  108f77:	c9                   	leave  
  108f78:	c3                   	ret    

00108f79 <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
  108f79:	f3 0f 1e fb          	endbr32 
  108f7d:	55                   	push   %ebp
  108f7e:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  108f80:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  108f84:	7e 14                	jle    108f9a <getuint+0x21>
        return va_arg(*ap, unsigned long long);
  108f86:	8b 45 08             	mov    0x8(%ebp),%eax
  108f89:	8b 00                	mov    (%eax),%eax
  108f8b:	8d 48 08             	lea    0x8(%eax),%ecx
  108f8e:	8b 55 08             	mov    0x8(%ebp),%edx
  108f91:	89 0a                	mov    %ecx,(%edx)
  108f93:	8b 50 04             	mov    0x4(%eax),%edx
  108f96:	8b 00                	mov    (%eax),%eax
  108f98:	eb 30                	jmp    108fca <getuint+0x51>
    }
    else if (lflag) {
  108f9a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  108f9e:	74 16                	je     108fb6 <getuint+0x3d>
        return va_arg(*ap, unsigned long);
  108fa0:	8b 45 08             	mov    0x8(%ebp),%eax
  108fa3:	8b 00                	mov    (%eax),%eax
  108fa5:	8d 48 04             	lea    0x4(%eax),%ecx
  108fa8:	8b 55 08             	mov    0x8(%ebp),%edx
  108fab:	89 0a                	mov    %ecx,(%edx)
  108fad:	8b 00                	mov    (%eax),%eax
  108faf:	ba 00 00 00 00       	mov    $0x0,%edx
  108fb4:	eb 14                	jmp    108fca <getuint+0x51>
    }
    else {
        return va_arg(*ap, unsigned int);
  108fb6:	8b 45 08             	mov    0x8(%ebp),%eax
  108fb9:	8b 00                	mov    (%eax),%eax
  108fbb:	8d 48 04             	lea    0x4(%eax),%ecx
  108fbe:	8b 55 08             	mov    0x8(%ebp),%edx
  108fc1:	89 0a                	mov    %ecx,(%edx)
  108fc3:	8b 00                	mov    (%eax),%eax
  108fc5:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
  108fca:	5d                   	pop    %ebp
  108fcb:	c3                   	ret    

00108fcc <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
  108fcc:	f3 0f 1e fb          	endbr32 
  108fd0:	55                   	push   %ebp
  108fd1:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  108fd3:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  108fd7:	7e 14                	jle    108fed <getint+0x21>
        return va_arg(*ap, long long);
  108fd9:	8b 45 08             	mov    0x8(%ebp),%eax
  108fdc:	8b 00                	mov    (%eax),%eax
  108fde:	8d 48 08             	lea    0x8(%eax),%ecx
  108fe1:	8b 55 08             	mov    0x8(%ebp),%edx
  108fe4:	89 0a                	mov    %ecx,(%edx)
  108fe6:	8b 50 04             	mov    0x4(%eax),%edx
  108fe9:	8b 00                	mov    (%eax),%eax
  108feb:	eb 28                	jmp    109015 <getint+0x49>
    }
    else if (lflag) {
  108fed:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  108ff1:	74 12                	je     109005 <getint+0x39>
        return va_arg(*ap, long);
  108ff3:	8b 45 08             	mov    0x8(%ebp),%eax
  108ff6:	8b 00                	mov    (%eax),%eax
  108ff8:	8d 48 04             	lea    0x4(%eax),%ecx
  108ffb:	8b 55 08             	mov    0x8(%ebp),%edx
  108ffe:	89 0a                	mov    %ecx,(%edx)
  109000:	8b 00                	mov    (%eax),%eax
  109002:	99                   	cltd   
  109003:	eb 10                	jmp    109015 <getint+0x49>
    }
    else {
        return va_arg(*ap, int);
  109005:	8b 45 08             	mov    0x8(%ebp),%eax
  109008:	8b 00                	mov    (%eax),%eax
  10900a:	8d 48 04             	lea    0x4(%eax),%ecx
  10900d:	8b 55 08             	mov    0x8(%ebp),%edx
  109010:	89 0a                	mov    %ecx,(%edx)
  109012:	8b 00                	mov    (%eax),%eax
  109014:	99                   	cltd   
    }
}
  109015:	5d                   	pop    %ebp
  109016:	c3                   	ret    

00109017 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
  109017:	f3 0f 1e fb          	endbr32 
  10901b:	55                   	push   %ebp
  10901c:	89 e5                	mov    %esp,%ebp
  10901e:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
  109021:	8d 45 14             	lea    0x14(%ebp),%eax
  109024:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
  109027:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10902a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10902e:	8b 45 10             	mov    0x10(%ebp),%eax
  109031:	89 44 24 08          	mov    %eax,0x8(%esp)
  109035:	8b 45 0c             	mov    0xc(%ebp),%eax
  109038:	89 44 24 04          	mov    %eax,0x4(%esp)
  10903c:	8b 45 08             	mov    0x8(%ebp),%eax
  10903f:	89 04 24             	mov    %eax,(%esp)
  109042:	e8 03 00 00 00       	call   10904a <vprintfmt>
    va_end(ap);
}
  109047:	90                   	nop
  109048:	c9                   	leave  
  109049:	c3                   	ret    

0010904a <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
  10904a:	f3 0f 1e fb          	endbr32 
  10904e:	55                   	push   %ebp
  10904f:	89 e5                	mov    %esp,%ebp
  109051:	56                   	push   %esi
  109052:	53                   	push   %ebx
  109053:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  109056:	eb 17                	jmp    10906f <vprintfmt+0x25>
            if (ch == '\0') {
  109058:	85 db                	test   %ebx,%ebx
  10905a:	0f 84 c0 03 00 00    	je     109420 <vprintfmt+0x3d6>
                return;
            }
            putch(ch, putdat);
  109060:	8b 45 0c             	mov    0xc(%ebp),%eax
  109063:	89 44 24 04          	mov    %eax,0x4(%esp)
  109067:	89 1c 24             	mov    %ebx,(%esp)
  10906a:	8b 45 08             	mov    0x8(%ebp),%eax
  10906d:	ff d0                	call   *%eax
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  10906f:	8b 45 10             	mov    0x10(%ebp),%eax
  109072:	8d 50 01             	lea    0x1(%eax),%edx
  109075:	89 55 10             	mov    %edx,0x10(%ebp)
  109078:	0f b6 00             	movzbl (%eax),%eax
  10907b:	0f b6 d8             	movzbl %al,%ebx
  10907e:	83 fb 25             	cmp    $0x25,%ebx
  109081:	75 d5                	jne    109058 <vprintfmt+0xe>
        }

        // Process a %-escape sequence
        char padc = ' ';
  109083:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
  109087:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
  10908e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  109091:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
  109094:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  10909b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10909e:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
  1090a1:	8b 45 10             	mov    0x10(%ebp),%eax
  1090a4:	8d 50 01             	lea    0x1(%eax),%edx
  1090a7:	89 55 10             	mov    %edx,0x10(%ebp)
  1090aa:	0f b6 00             	movzbl (%eax),%eax
  1090ad:	0f b6 d8             	movzbl %al,%ebx
  1090b0:	8d 43 dd             	lea    -0x23(%ebx),%eax
  1090b3:	83 f8 55             	cmp    $0x55,%eax
  1090b6:	0f 87 38 03 00 00    	ja     1093f4 <vprintfmt+0x3aa>
  1090bc:	8b 04 85 60 b0 10 00 	mov    0x10b060(,%eax,4),%eax
  1090c3:	3e ff e0             	notrack jmp *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
  1090c6:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
  1090ca:	eb d5                	jmp    1090a1 <vprintfmt+0x57>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
  1090cc:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
  1090d0:	eb cf                	jmp    1090a1 <vprintfmt+0x57>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
  1090d2:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
  1090d9:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  1090dc:	89 d0                	mov    %edx,%eax
  1090de:	c1 e0 02             	shl    $0x2,%eax
  1090e1:	01 d0                	add    %edx,%eax
  1090e3:	01 c0                	add    %eax,%eax
  1090e5:	01 d8                	add    %ebx,%eax
  1090e7:	83 e8 30             	sub    $0x30,%eax
  1090ea:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
  1090ed:	8b 45 10             	mov    0x10(%ebp),%eax
  1090f0:	0f b6 00             	movzbl (%eax),%eax
  1090f3:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
  1090f6:	83 fb 2f             	cmp    $0x2f,%ebx
  1090f9:	7e 38                	jle    109133 <vprintfmt+0xe9>
  1090fb:	83 fb 39             	cmp    $0x39,%ebx
  1090fe:	7f 33                	jg     109133 <vprintfmt+0xe9>
            for (precision = 0; ; ++ fmt) {
  109100:	ff 45 10             	incl   0x10(%ebp)
                precision = precision * 10 + ch - '0';
  109103:	eb d4                	jmp    1090d9 <vprintfmt+0x8f>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
  109105:	8b 45 14             	mov    0x14(%ebp),%eax
  109108:	8d 50 04             	lea    0x4(%eax),%edx
  10910b:	89 55 14             	mov    %edx,0x14(%ebp)
  10910e:	8b 00                	mov    (%eax),%eax
  109110:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
  109113:	eb 1f                	jmp    109134 <vprintfmt+0xea>

        case '.':
            if (width < 0)
  109115:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  109119:	79 86                	jns    1090a1 <vprintfmt+0x57>
                width = 0;
  10911b:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
  109122:	e9 7a ff ff ff       	jmp    1090a1 <vprintfmt+0x57>

        case '#':
            altflag = 1;
  109127:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
  10912e:	e9 6e ff ff ff       	jmp    1090a1 <vprintfmt+0x57>
            goto process_precision;
  109133:	90                   	nop

        process_precision:
            if (width < 0)
  109134:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  109138:	0f 89 63 ff ff ff    	jns    1090a1 <vprintfmt+0x57>
                width = precision, precision = -1;
  10913e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  109141:	89 45 e8             	mov    %eax,-0x18(%ebp)
  109144:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
  10914b:	e9 51 ff ff ff       	jmp    1090a1 <vprintfmt+0x57>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
  109150:	ff 45 e0             	incl   -0x20(%ebp)
            goto reswitch;
  109153:	e9 49 ff ff ff       	jmp    1090a1 <vprintfmt+0x57>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
  109158:	8b 45 14             	mov    0x14(%ebp),%eax
  10915b:	8d 50 04             	lea    0x4(%eax),%edx
  10915e:	89 55 14             	mov    %edx,0x14(%ebp)
  109161:	8b 00                	mov    (%eax),%eax
  109163:	8b 55 0c             	mov    0xc(%ebp),%edx
  109166:	89 54 24 04          	mov    %edx,0x4(%esp)
  10916a:	89 04 24             	mov    %eax,(%esp)
  10916d:	8b 45 08             	mov    0x8(%ebp),%eax
  109170:	ff d0                	call   *%eax
            break;
  109172:	e9 a4 02 00 00       	jmp    10941b <vprintfmt+0x3d1>

        // error message
        case 'e':
            err = va_arg(ap, int);
  109177:	8b 45 14             	mov    0x14(%ebp),%eax
  10917a:	8d 50 04             	lea    0x4(%eax),%edx
  10917d:	89 55 14             	mov    %edx,0x14(%ebp)
  109180:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
  109182:	85 db                	test   %ebx,%ebx
  109184:	79 02                	jns    109188 <vprintfmt+0x13e>
                err = -err;
  109186:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
  109188:	83 fb 06             	cmp    $0x6,%ebx
  10918b:	7f 0b                	jg     109198 <vprintfmt+0x14e>
  10918d:	8b 34 9d 20 b0 10 00 	mov    0x10b020(,%ebx,4),%esi
  109194:	85 f6                	test   %esi,%esi
  109196:	75 23                	jne    1091bb <vprintfmt+0x171>
                printfmt(putch, putdat, "error %d", err);
  109198:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  10919c:	c7 44 24 08 4d b0 10 	movl   $0x10b04d,0x8(%esp)
  1091a3:	00 
  1091a4:	8b 45 0c             	mov    0xc(%ebp),%eax
  1091a7:	89 44 24 04          	mov    %eax,0x4(%esp)
  1091ab:	8b 45 08             	mov    0x8(%ebp),%eax
  1091ae:	89 04 24             	mov    %eax,(%esp)
  1091b1:	e8 61 fe ff ff       	call   109017 <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
  1091b6:	e9 60 02 00 00       	jmp    10941b <vprintfmt+0x3d1>
                printfmt(putch, putdat, "%s", p);
  1091bb:	89 74 24 0c          	mov    %esi,0xc(%esp)
  1091bf:	c7 44 24 08 56 b0 10 	movl   $0x10b056,0x8(%esp)
  1091c6:	00 
  1091c7:	8b 45 0c             	mov    0xc(%ebp),%eax
  1091ca:	89 44 24 04          	mov    %eax,0x4(%esp)
  1091ce:	8b 45 08             	mov    0x8(%ebp),%eax
  1091d1:	89 04 24             	mov    %eax,(%esp)
  1091d4:	e8 3e fe ff ff       	call   109017 <printfmt>
            break;
  1091d9:	e9 3d 02 00 00       	jmp    10941b <vprintfmt+0x3d1>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
  1091de:	8b 45 14             	mov    0x14(%ebp),%eax
  1091e1:	8d 50 04             	lea    0x4(%eax),%edx
  1091e4:	89 55 14             	mov    %edx,0x14(%ebp)
  1091e7:	8b 30                	mov    (%eax),%esi
  1091e9:	85 f6                	test   %esi,%esi
  1091eb:	75 05                	jne    1091f2 <vprintfmt+0x1a8>
                p = "(null)";
  1091ed:	be 59 b0 10 00       	mov    $0x10b059,%esi
            }
            if (width > 0 && padc != '-') {
  1091f2:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  1091f6:	7e 76                	jle    10926e <vprintfmt+0x224>
  1091f8:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
  1091fc:	74 70                	je     10926e <vprintfmt+0x224>
                for (width -= strnlen(p, precision); width > 0; width --) {
  1091fe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  109201:	89 44 24 04          	mov    %eax,0x4(%esp)
  109205:	89 34 24             	mov    %esi,(%esp)
  109208:	e8 ba f7 ff ff       	call   1089c7 <strnlen>
  10920d:	8b 55 e8             	mov    -0x18(%ebp),%edx
  109210:	29 c2                	sub    %eax,%edx
  109212:	89 d0                	mov    %edx,%eax
  109214:	89 45 e8             	mov    %eax,-0x18(%ebp)
  109217:	eb 16                	jmp    10922f <vprintfmt+0x1e5>
                    putch(padc, putdat);
  109219:	0f be 45 db          	movsbl -0x25(%ebp),%eax
  10921d:	8b 55 0c             	mov    0xc(%ebp),%edx
  109220:	89 54 24 04          	mov    %edx,0x4(%esp)
  109224:	89 04 24             	mov    %eax,(%esp)
  109227:	8b 45 08             	mov    0x8(%ebp),%eax
  10922a:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
  10922c:	ff 4d e8             	decl   -0x18(%ebp)
  10922f:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  109233:	7f e4                	jg     109219 <vprintfmt+0x1cf>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  109235:	eb 37                	jmp    10926e <vprintfmt+0x224>
                if (altflag && (ch < ' ' || ch > '~')) {
  109237:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  10923b:	74 1f                	je     10925c <vprintfmt+0x212>
  10923d:	83 fb 1f             	cmp    $0x1f,%ebx
  109240:	7e 05                	jle    109247 <vprintfmt+0x1fd>
  109242:	83 fb 7e             	cmp    $0x7e,%ebx
  109245:	7e 15                	jle    10925c <vprintfmt+0x212>
                    putch('?', putdat);
  109247:	8b 45 0c             	mov    0xc(%ebp),%eax
  10924a:	89 44 24 04          	mov    %eax,0x4(%esp)
  10924e:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
  109255:	8b 45 08             	mov    0x8(%ebp),%eax
  109258:	ff d0                	call   *%eax
  10925a:	eb 0f                	jmp    10926b <vprintfmt+0x221>
                }
                else {
                    putch(ch, putdat);
  10925c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10925f:	89 44 24 04          	mov    %eax,0x4(%esp)
  109263:	89 1c 24             	mov    %ebx,(%esp)
  109266:	8b 45 08             	mov    0x8(%ebp),%eax
  109269:	ff d0                	call   *%eax
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  10926b:	ff 4d e8             	decl   -0x18(%ebp)
  10926e:	89 f0                	mov    %esi,%eax
  109270:	8d 70 01             	lea    0x1(%eax),%esi
  109273:	0f b6 00             	movzbl (%eax),%eax
  109276:	0f be d8             	movsbl %al,%ebx
  109279:	85 db                	test   %ebx,%ebx
  10927b:	74 27                	je     1092a4 <vprintfmt+0x25a>
  10927d:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  109281:	78 b4                	js     109237 <vprintfmt+0x1ed>
  109283:	ff 4d e4             	decl   -0x1c(%ebp)
  109286:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  10928a:	79 ab                	jns    109237 <vprintfmt+0x1ed>
                }
            }
            for (; width > 0; width --) {
  10928c:	eb 16                	jmp    1092a4 <vprintfmt+0x25a>
                putch(' ', putdat);
  10928e:	8b 45 0c             	mov    0xc(%ebp),%eax
  109291:	89 44 24 04          	mov    %eax,0x4(%esp)
  109295:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  10929c:	8b 45 08             	mov    0x8(%ebp),%eax
  10929f:	ff d0                	call   *%eax
            for (; width > 0; width --) {
  1092a1:	ff 4d e8             	decl   -0x18(%ebp)
  1092a4:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  1092a8:	7f e4                	jg     10928e <vprintfmt+0x244>
            }
            break;
  1092aa:	e9 6c 01 00 00       	jmp    10941b <vprintfmt+0x3d1>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
  1092af:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1092b2:	89 44 24 04          	mov    %eax,0x4(%esp)
  1092b6:	8d 45 14             	lea    0x14(%ebp),%eax
  1092b9:	89 04 24             	mov    %eax,(%esp)
  1092bc:	e8 0b fd ff ff       	call   108fcc <getint>
  1092c1:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1092c4:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
  1092c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1092ca:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1092cd:	85 d2                	test   %edx,%edx
  1092cf:	79 26                	jns    1092f7 <vprintfmt+0x2ad>
                putch('-', putdat);
  1092d1:	8b 45 0c             	mov    0xc(%ebp),%eax
  1092d4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1092d8:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
  1092df:	8b 45 08             	mov    0x8(%ebp),%eax
  1092e2:	ff d0                	call   *%eax
                num = -(long long)num;
  1092e4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1092e7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1092ea:	f7 d8                	neg    %eax
  1092ec:	83 d2 00             	adc    $0x0,%edx
  1092ef:	f7 da                	neg    %edx
  1092f1:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1092f4:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
  1092f7:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  1092fe:	e9 a8 00 00 00       	jmp    1093ab <vprintfmt+0x361>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
  109303:	8b 45 e0             	mov    -0x20(%ebp),%eax
  109306:	89 44 24 04          	mov    %eax,0x4(%esp)
  10930a:	8d 45 14             	lea    0x14(%ebp),%eax
  10930d:	89 04 24             	mov    %eax,(%esp)
  109310:	e8 64 fc ff ff       	call   108f79 <getuint>
  109315:	89 45 f0             	mov    %eax,-0x10(%ebp)
  109318:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
  10931b:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  109322:	e9 84 00 00 00       	jmp    1093ab <vprintfmt+0x361>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
  109327:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10932a:	89 44 24 04          	mov    %eax,0x4(%esp)
  10932e:	8d 45 14             	lea    0x14(%ebp),%eax
  109331:	89 04 24             	mov    %eax,(%esp)
  109334:	e8 40 fc ff ff       	call   108f79 <getuint>
  109339:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10933c:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
  10933f:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
  109346:	eb 63                	jmp    1093ab <vprintfmt+0x361>

        // pointer
        case 'p':
            putch('0', putdat);
  109348:	8b 45 0c             	mov    0xc(%ebp),%eax
  10934b:	89 44 24 04          	mov    %eax,0x4(%esp)
  10934f:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
  109356:	8b 45 08             	mov    0x8(%ebp),%eax
  109359:	ff d0                	call   *%eax
            putch('x', putdat);
  10935b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10935e:	89 44 24 04          	mov    %eax,0x4(%esp)
  109362:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
  109369:	8b 45 08             	mov    0x8(%ebp),%eax
  10936c:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
  10936e:	8b 45 14             	mov    0x14(%ebp),%eax
  109371:	8d 50 04             	lea    0x4(%eax),%edx
  109374:	89 55 14             	mov    %edx,0x14(%ebp)
  109377:	8b 00                	mov    (%eax),%eax
  109379:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10937c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
  109383:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
  10938a:	eb 1f                	jmp    1093ab <vprintfmt+0x361>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
  10938c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10938f:	89 44 24 04          	mov    %eax,0x4(%esp)
  109393:	8d 45 14             	lea    0x14(%ebp),%eax
  109396:	89 04 24             	mov    %eax,(%esp)
  109399:	e8 db fb ff ff       	call   108f79 <getuint>
  10939e:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1093a1:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
  1093a4:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
  1093ab:	0f be 55 db          	movsbl -0x25(%ebp),%edx
  1093af:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1093b2:	89 54 24 18          	mov    %edx,0x18(%esp)
  1093b6:	8b 55 e8             	mov    -0x18(%ebp),%edx
  1093b9:	89 54 24 14          	mov    %edx,0x14(%esp)
  1093bd:	89 44 24 10          	mov    %eax,0x10(%esp)
  1093c1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1093c4:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1093c7:	89 44 24 08          	mov    %eax,0x8(%esp)
  1093cb:	89 54 24 0c          	mov    %edx,0xc(%esp)
  1093cf:	8b 45 0c             	mov    0xc(%ebp),%eax
  1093d2:	89 44 24 04          	mov    %eax,0x4(%esp)
  1093d6:	8b 45 08             	mov    0x8(%ebp),%eax
  1093d9:	89 04 24             	mov    %eax,(%esp)
  1093dc:	e8 94 fa ff ff       	call   108e75 <printnum>
            break;
  1093e1:	eb 38                	jmp    10941b <vprintfmt+0x3d1>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
  1093e3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1093e6:	89 44 24 04          	mov    %eax,0x4(%esp)
  1093ea:	89 1c 24             	mov    %ebx,(%esp)
  1093ed:	8b 45 08             	mov    0x8(%ebp),%eax
  1093f0:	ff d0                	call   *%eax
            break;
  1093f2:	eb 27                	jmp    10941b <vprintfmt+0x3d1>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
  1093f4:	8b 45 0c             	mov    0xc(%ebp),%eax
  1093f7:	89 44 24 04          	mov    %eax,0x4(%esp)
  1093fb:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
  109402:	8b 45 08             	mov    0x8(%ebp),%eax
  109405:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
  109407:	ff 4d 10             	decl   0x10(%ebp)
  10940a:	eb 03                	jmp    10940f <vprintfmt+0x3c5>
  10940c:	ff 4d 10             	decl   0x10(%ebp)
  10940f:	8b 45 10             	mov    0x10(%ebp),%eax
  109412:	48                   	dec    %eax
  109413:	0f b6 00             	movzbl (%eax),%eax
  109416:	3c 25                	cmp    $0x25,%al
  109418:	75 f2                	jne    10940c <vprintfmt+0x3c2>
                /* do nothing */;
            break;
  10941a:	90                   	nop
    while (1) {
  10941b:	e9 36 fc ff ff       	jmp    109056 <vprintfmt+0xc>
                return;
  109420:	90                   	nop
        }
    }
}
  109421:	83 c4 40             	add    $0x40,%esp
  109424:	5b                   	pop    %ebx
  109425:	5e                   	pop    %esi
  109426:	5d                   	pop    %ebp
  109427:	c3                   	ret    

00109428 <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
  109428:	f3 0f 1e fb          	endbr32 
  10942c:	55                   	push   %ebp
  10942d:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
  10942f:	8b 45 0c             	mov    0xc(%ebp),%eax
  109432:	8b 40 08             	mov    0x8(%eax),%eax
  109435:	8d 50 01             	lea    0x1(%eax),%edx
  109438:	8b 45 0c             	mov    0xc(%ebp),%eax
  10943b:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
  10943e:	8b 45 0c             	mov    0xc(%ebp),%eax
  109441:	8b 10                	mov    (%eax),%edx
  109443:	8b 45 0c             	mov    0xc(%ebp),%eax
  109446:	8b 40 04             	mov    0x4(%eax),%eax
  109449:	39 c2                	cmp    %eax,%edx
  10944b:	73 12                	jae    10945f <sprintputch+0x37>
        *b->buf ++ = ch;
  10944d:	8b 45 0c             	mov    0xc(%ebp),%eax
  109450:	8b 00                	mov    (%eax),%eax
  109452:	8d 48 01             	lea    0x1(%eax),%ecx
  109455:	8b 55 0c             	mov    0xc(%ebp),%edx
  109458:	89 0a                	mov    %ecx,(%edx)
  10945a:	8b 55 08             	mov    0x8(%ebp),%edx
  10945d:	88 10                	mov    %dl,(%eax)
    }
}
  10945f:	90                   	nop
  109460:	5d                   	pop    %ebp
  109461:	c3                   	ret    

00109462 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
  109462:	f3 0f 1e fb          	endbr32 
  109466:	55                   	push   %ebp
  109467:	89 e5                	mov    %esp,%ebp
  109469:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  10946c:	8d 45 14             	lea    0x14(%ebp),%eax
  10946f:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
  109472:	8b 45 f0             	mov    -0x10(%ebp),%eax
  109475:	89 44 24 0c          	mov    %eax,0xc(%esp)
  109479:	8b 45 10             	mov    0x10(%ebp),%eax
  10947c:	89 44 24 08          	mov    %eax,0x8(%esp)
  109480:	8b 45 0c             	mov    0xc(%ebp),%eax
  109483:	89 44 24 04          	mov    %eax,0x4(%esp)
  109487:	8b 45 08             	mov    0x8(%ebp),%eax
  10948a:	89 04 24             	mov    %eax,(%esp)
  10948d:	e8 08 00 00 00       	call   10949a <vsnprintf>
  109492:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  109495:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  109498:	c9                   	leave  
  109499:	c3                   	ret    

0010949a <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
  10949a:	f3 0f 1e fb          	endbr32 
  10949e:	55                   	push   %ebp
  10949f:	89 e5                	mov    %esp,%ebp
  1094a1:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
  1094a4:	8b 45 08             	mov    0x8(%ebp),%eax
  1094a7:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1094aa:	8b 45 0c             	mov    0xc(%ebp),%eax
  1094ad:	8d 50 ff             	lea    -0x1(%eax),%edx
  1094b0:	8b 45 08             	mov    0x8(%ebp),%eax
  1094b3:	01 d0                	add    %edx,%eax
  1094b5:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1094b8:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
  1094bf:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  1094c3:	74 0a                	je     1094cf <vsnprintf+0x35>
  1094c5:	8b 55 ec             	mov    -0x14(%ebp),%edx
  1094c8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1094cb:	39 c2                	cmp    %eax,%edx
  1094cd:	76 07                	jbe    1094d6 <vsnprintf+0x3c>
        return -E_INVAL;
  1094cf:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  1094d4:	eb 2a                	jmp    109500 <vsnprintf+0x66>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
  1094d6:	8b 45 14             	mov    0x14(%ebp),%eax
  1094d9:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1094dd:	8b 45 10             	mov    0x10(%ebp),%eax
  1094e0:	89 44 24 08          	mov    %eax,0x8(%esp)
  1094e4:	8d 45 ec             	lea    -0x14(%ebp),%eax
  1094e7:	89 44 24 04          	mov    %eax,0x4(%esp)
  1094eb:	c7 04 24 28 94 10 00 	movl   $0x109428,(%esp)
  1094f2:	e8 53 fb ff ff       	call   10904a <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
  1094f7:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1094fa:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
  1094fd:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  109500:	c9                   	leave  
  109501:	c3                   	ret    
